Well, we've finally succeeded in pulling most of the
interesting functionality off of the SessionImpl class
(thanks steve!)

And now, I think its time to finally pull it apart
altogether! I can see five basic responsibilities
that SessionImpl has currently:

(1) implementing org.hibernate.Session
(2) being a persistence context
(3) producing events and acting as an
   intermediary, eg. between SQLQueryImpl
   and SQLLoader
(4) scheduling actions
(5) JDBC Connection management

I'm thinking we should investigate splitting those
things off into four different classes:

* SessionImpl is a trivial implementation of Session

* PersistenceContext holds the cache (it basically
 takes on the role defined by currently by the
 SessionImplementor interface), it is used by
 events, persisters, loaders, types

* ActionQueue queues and asynchronously executes
 actions, it is used by the events

* EventSource produces events and subsumes the current
 responsibilities of SessionListenerEventConfig, also
 mediates access to the PersistenceContext and
 ActionQueue from the events

* Something else (?) holds the JDBC connection and
 does the little bits of tx-related stuff that
 currently sit in SessionImpl

? Not sure what is responsible for intermediating
 between XXXXQueryImpl and XXXLoader. Perhaps it
 could go directly on the QueryImpl.

Well, PersistenceContext will still end up pretty big,
but at least it will be doing "just one thing".


What do you guys think?

P.S. Next thing on the list after that is to split
BasicEntityPersister. Not sure whether we should do
that by splitting out the JDBC-related methods into
some kind of commands (InsertCommand, UpdateCommand,
etc), or whether we should just make another abstract
superclass of BasicEntityPersister, called, maybe
JdbcEntityPersister.


-- Gavin King +61 41 053 4454 +1 404 822 8349 callto://gavinking

Hibernate
[EMAIL PROTECTED]
http://hibernate.org

JBoss Inc
[EMAIL PROTECTED]
http://jboss.com



-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to