Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns

by perrin (Chancellor)
on Aug 10, 2005 at 20:23 UTC ( [id://482749]=note: print w/replies, xml ) Need Help??


in reply to Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns

There is no need to use Value Objects in Perl. These can just be hashes. Class::DBI classes are your DAOs.
  • Comment on Re: Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns

Replies are listed 'Best First'.
Re^2: Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns
by Transient (Hermit) on Aug 10, 2005 at 20:41 UTC
    This is spot on. The DAO is just an abstraction layer to your actual datasource.

    The VO's are unnecessary, but then again, it wouldn't necessarily hurt to make a specific one - after all, most objects in Perl are just blessed hashrefs. Throw in some auto-generated getters and setters and you're done.
Re^2: Quite confuse about using Class::DBI to implement Data Access Objects and Value Objects Design Patterns
by monsieur_champs (Curate) on Aug 10, 2005 at 22:02 UTC

    Shall I use VOs at all? Or this is kind of a purist approach to the problem?

    Thanks for answering!

      In Java, VOs are usually a solution to the problem that remote method calls are very slow and DAOs are often implemented with something that uses remote method calls, like old-school EJBs. I don't think you need them. I don't use them in my perl stuff. It is normal in perl to call methods passing in a hash (the standard "named parameters" pattern). This should be enough.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://482749]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (3)
As of 2024-04-19 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found