1 2 3 Previous Next 31 Replies Latest reply: Mar 17, 2008 2:16 PM by 843853 RSS

    DAO Design pattern

    843853
      Hi,
      what is the advantages of DAO Design pattern over other design patterns?
      Can anybody tel me
        • 1. Re: DAO Design pattern
          843853
          what is the advantages of DAO Design pattern over other design patterns?
          It's intended to encapsulate access to a data source, whereas other patterns aren't. Seriously, the best answer I can think of for a general "Why is pattern A better than pattern B" question is that pattern A suits the problem pattern A is designed to solve better than pattern B. Aside from that, the DAO pattern has no "advantage" over, say, the Flyweight pattern. They're orthogonal in purpose.

          ~
          • 2. Re: DAO Design pattern
            843853
            This is like asking what advantage cheese has over a stapler
            • 3. Re: DAO Design pattern
              843853
              This is like asking what advantage cheese has over a stapler
              That should be obvious.

              ~
              • 4. Re: DAO Design pattern
                3004
                NANDA wrote:
                Hi,
                what is the advantages of DAO Design pattern over other design patterns?
                Can anybody tel me
                the answer is none!

                DAO stands for data access object, it is a non oo pattern, oo is data centric, it makes sense for data to access data. it is something created by poor procedural minds who can never understand what oo is.

                you may occasionary use it as a collection of functionalities or utilities, but thou shalt never use in as a pattern in oop!
                • 5. Re: DAO Design pattern
                  843853
                  valooCK wrote:
                  NANDA wrote:
                  Hi,
                  what is the advantages of DAO Design pattern over other design patterns?
                  Can anybody tel me
                  the answer is none!

                  DAO stands for data access object, it is a non oo pattern, oo is data centric, it makes sense for data to access data. it is something created by poor procedural minds who can never understand what oo is.

                  you may occasionary use it as a collection of functionalities or utilities, but thou shalt never use in as a pattern in oop!
                  There are as-yet undiscovered tribes living in the Amazon, who knew you were going to say that

                  @OP: Please ignore this troll, he doesn't even understand the very basics of OO, as can be demonstrated in the following thread

                  http://forum.java.sun.com/thread.jspa?threadID=5273397&tstart=0

                  Just ignore him. He only wants attention. He hasn't got the faintest idea how to write even "Hello World", let alone actually do any OO design
                  • 6. Re: DAO Design pattern
                    843853
                    If my assumption here is correct, I think what OP was asking is if DAO is better than other solutions for data access. Either way, we need to know more about your requirements before we can provide specific advantages. But the primary advantages of the DAO pattern are encapsulation, a clean separation of business logic from data logic, and centralized access (to name a few).
                    • 7. Re: DAO Design pattern
                      796254
                      I'd recommend Martin Fowler's "Patterns Of Enterprise App Arch". He's got a nice chapter on persistence patterns.

                      http://www.amazon.com/Enterprise-Application-Architecture-Addison-Wesley-Signature/dp/0321127420/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1205517045&sr=8-1

                      http://martinfowler.com/eaaCatalog/

                      Table and row data gateways, active record, data mapper, etc.

                      %
                      • 8. Re: DAO Design pattern
                        3004
                        wpafbuser1 wrote:
                        But the primary advantages of the DAO pattern are encapsulation, a clean separation of business logic from data logic, and centralized access (to name a few).
                        this clearly indicates that you have no idea of what encapuslation is. DAO is merely a collection of procedurals, nothing is encapuslated at all, everything is wide open.
                        • 9. Re: DAO Design pattern
                          796254
                          ValooCK versus wpafbuser1. Oh, my.

                          Wow, it's like Godzilla versus Mothra, or Predator versus Alien!

                          It's the Battle of the Trolls for forum domination!

                          %
                          • 10. Re: DAO Design pattern
                            3004
                            duffymo wrote:
                            ValooCK versus wpafbuser1. Oh, my.

                            Wow, it's like Godzilla versus Mothra, or Predator versus Alien!

                            It's the Battle of the Trolls for forum domination!

                            %
                            as for you, man, gateways, datamappers are not what you think. dont use dao as a pattern in your code, its a shitiey way of doing things.
                            • 11. Re: DAO Design pattern
                              796254
                              valooCK wrote:
                              duffymo wrote:
                              ValooCK versus wpafbuser1. Oh, my.

                              Wow, it's like Godzilla versus Mothra, or Predator versus Alien!

                              It's the Battle of the Trolls for forum domination!

                              %
                              as for you, man, gateways, datamappers are not what you think. dont use dao as a pattern in your code, its a shitiey way of doing things.
                              Right, nobody uses that. I mean, a Google search on "data access object" turns up nothing:

                              http://www.google.com/search?q=data+access+object&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

                              Look, everybody agrees with valoo CK! The whole CS community is behind him!

                              %
                              • 12. Re: DAO Design pattern
                                843853
                                duffymo wrote:
                                ValooCK versus wpafbuser1. Oh, my.

                                Wow, it's like Godzilla versus Mothra, or Predator versus Alien!

                                It's the Battle of the Trolls for forum domination!

                                %
                                LMAO! Am I really as bad as Valoo? You gotta give me more credit than that.
                                • 13. Re: DAO Design pattern
                                  843853
                                  dont use dao as a pattern in your code, its a shitiey way of doing things.
                                  I can understand the reason for that misdirected advice, given the apparent difficulty the source has in simply implementing an interface*.

                                  ~

                                  * http://forum.java.sun.com/thread.jspa?threadID=5274699&start=38
                                  • 14. Re: DAO Design pattern
                                    3004
                                    >
                                    LMAO! Am I really as bad as Valoo? You gotta give me more credit than that.
                                    duffy will transfer his abstract purple object to you as credit. but before that can happen, you need to understand what encapsulation is. simply wrap up something so that others dont have write their own code is not always encapsulation. one good way of checking is this:

                                    encapsulation produces abstraction.

                                    does a DAO produces abstraction? lets see: here you have a chickenDAO, and a duckDAO. what are the differences: the duckDAO has more functions than the chickenDAO, and thats it. you have only one abstraction. so thats not encapsulation.

                                    what is the difference between chickenDTO and a duckDTO? the former has more slots so that you can put more bits in it, and thats it. there is no chicken abstraction nor duck abstraction. so that's not encapsulation.
                                    1 2 3 Previous Next