Hi Laki,
I'm a total noob with RIFE, and very impressed by its features.
Finding that using hibernate for persistence is as efficient as
killing a mosquito with a bazooka, i'm looking at RIFE's built in
persistence, and it seems to be exactly what i need.
Nice to hear, let us know what you think of it once you've used it a
bit more extensively. Any suggestions or ideas for improvement are
always welcome.
My first question is about design : coming from Hibernate, i'm used
to Data Access Objects.
Porting it to RIFE with my new project, i have an Address bean, so
i made an AddressDAO, extending DbQueryManager. Is it the right way
to do this, or is it completely dumb ?
This is the right way if you want total control or perform custom
queries. However, over time we noticed that for a lot of operations
you're often doing the same thing over and over again (crud
operations). That's why we created the GenericQueryManager to allow
you to perform these operations very easily, and still be able to
customize them when needed. More info:
http://rifers.org/wiki/display/RIFE/Generic+query+manager
If you want to handle rich content, you can also look at the
ContentQueryManager:
http://rifers.org/wiki/display/RIFE/Content+management
+framework#Contentmanagementframework-3
To test it, i added an install method in my address DAO :
public void install() {
CreateTable create = new CreateTable(getDatasource());
create.table("ADDRESS").columns(Address.class).primaryKey
("id").column(
"addr1", String.class);
executeUpdate(create);
}
I was assuming that RIFE would only create id and addr1 in my
ADDRESS table, but actually RIFE created all the other fields (it's
great : i wouldn't have liked to have to declare all my fields in
my table statement ! ). But the fields are created in alphabetical
order. Is there a way to change this ?
Not in the current release. However, I changed this in the current
SVN repository. As of next release (or the current nightly snapshot
http://rifers.org/downloads/rife/snapshots/), the order will be
exactly the same as the order of the accessors in your bean. This has
also changed for everything that relies on beans elsewhere in the
framework.
In addition, while RIFE's javadoc is one of the most detailed i've
seen, it appears that the CreateTable is poorly documented.
Sadly, some classes badly need javadocs indeed. They mostly date from
the earlier days of the framework and never were documented even
though all new commits now require full javadocs. Feel free to help
out here, it's an ideal way to contribute.
Even though the methods' names are explicit, what for example does
unique or check do ?
These map directly to unique or check constraints on your database
table. I don't know which database you're using, but this is quite
common in all DBs besides MySQL. More info here:
http://www.postgresql.org/docs/8.1/interactive/sql-createtable.html
(look for check and unique)
Thanks in advance for your help, i will certainly frequently ask
dumb questions in the coming weeks, please don't blame me ;-)
Don't worry. Ask as many questions as you like. We'll try to be as
helpful as possible.
Best regards,
Geert
--
Geert Bevin Uwyn bvba GTalk: [EMAIL PROTECTED]
"Use what you need" Avenue de Scailmont 34 Skype: gbevin
http://www.uwyn.com 7170 Manage, Belgium AIM: geertbevin
gbevin at uwyn dot com Tel: +32 64 84 80 03 Mobile: +32 477 302 599
PGP Fingerprint : 4E21 6399 CD9E A384 6619 719A C8F4 D40D 309F D6A9
Public PGP key : available at servers pgp.mit.edu, wwwkeys.pgp.net
_______________________________________________
Rife-users mailing list
[email protected]
http://lists.uwyn.com/mailman/listinfo/rife-users