Search the web
Sign In
New User? Sign Up
SimpleORM
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
DataSet vs Session   Message List  
Reply | Forward Message #1562 of 1851 |
Hello Franck,

I have been hacking quite a lot today. Unifying Session and
DataSet. Needs more thought.

Renamed
1. SDataSet to SDataSetTemp
2. SSession to SDataSet
Then created SPersisterDatabase that extends SPersister.
Goal to unify SDataSetTemp and SDataSet into the same class, but with
database things going into SPersisterDatabase.

Clearly we want the .database code in a separate jar from the .record
SDataSet.
Things like having a default session attached to the thread has
nothing to do with the database and can go in .record instead of .database.

Unifying means that the user can write things like
ses.findOrCreate(...)
and ses IS a data set, no delegating all the methods.
That was the motivation.

A database DataSet is then just a DataSet that has a
SPersisterDatabase SPersister.

But...

The current code creates a new SDataSetTemp every time a transaction
begin()s. And the reference is nulled after commit(). This
obviously cannot happen after unification. Instead, we would destroy
the records and cache maps as in 2.*.

After unification, "detaching" a dataset just means changing the
persister to be the trivial non-database one, and clearing the thread local.

I still think the merge is a good idea, but I will stop short of
actually doing it. It would then be quite easy to undo the renames
if we changed our minds. We are biting off a lot more than I wanted
to, but getting these structures right is critical because they are
difficult to change later.

(In some way we have come around in a big circle. They were unified
in 2.*, then we split out DataSet, then we unified them again in a
different way but with the persister split out.)

(There are, of course, far to many public things at the moment. Once
everything is moved need to restrict it all again.)

Anthony



Dr Anthony Berglas, anthony@... Mobile: +61 4 4838 8874
Just because it is possible to push twigs along the ground with ones nose
does not necessarily mean that is the best way to collect firewood.




Sun Jul 6, 2008 9:59 am

aberglas
Offline Offline
Send Email Send Email

Forward
Message #1562 of 1851 |
Expand Messages Author Sort by Date

Hello Franck, I have been hacking quite a lot today. Unifying Session and DataSet. Needs more thought. Renamed 1. SDataSet to SDataSetTemp 2. SSession to...
Anthony Berglas
aberglas
Offline Send Email
Jul 6, 2008
9:59 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help