in reply to Re^2: Perl Entity Bean
in thread Perl Entity Bean
in the Java world, there are magic libraries that people never really have to know about ... But with Perl, we generally see more of the guts of packages
If you're talking about Class::DBI, then I have to disagree. The only thing you have to do is define the table structure. It handles all the SQL behind the scenes, as well as the creation of classes. And if you don't even want to define the table structure, there's Class::DBI::Loader, which reads it directly from the database. I'm not sure how much more magical you can get.
If you're talking about Perl and Java in general, then, again, I can't agree. My experience says the opposite. I find Perl modules do more "magic" than Java libraries, on the whole. Perhaps you could convince me otherwise with some specific examples, but I digress.
It says it creates the accessors/mutators, but it's not clear whether they're just get/set methods or (as it seems to imply) that it creates lvalue methods
It's pretty clear to me that they're the argument-taking variety of get/set methods, rather than lvalues. Here's an example from the SYNOPSIS:
my $cd = $artist->add_to_cds({ cdid => 1, title => 'October', year => 1980, }); # Oops, got it wrong. $cd->year(1981); $cd->update;
Notice the call to year on the $cd object.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Entity Bean
by rje (Deacon) on Dec 29, 2004 at 14:54 UTC | |
by revdiablo (Prior) on Dec 29, 2004 at 18:22 UTC | |
by rje (Deacon) on Dec 30, 2004 at 18:23 UTC | |
by jplindstrom (Monsignor) on Dec 30, 2004 at 19:27 UTC |