Re: General design question-nanning/prevayler

Jon Tirsén <[email protected]> Tue, 11 Mar 2003 17:38:42 +0100 (CET)
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
 --- Saimon Moore <[email protected]> skrev: >
Hi,
> 
> I'm designing a small e-commerce web app and I'm
> using
> the nanning/prevayler combination.
> 
> I've got a couple of questions as regards how the
> design is affected. From what I've seen, for
> 'aspects'
> to be persisted, they need to be created within the
> prevaylent system (i.e. IdentifyingSystem).

For objects to be persisted they need to be added to
the system or to an object that is already peristent.
They can be instantiated outside the system or outside
a transaction.

> So I basically need to have one
> interface/implementation, responsible for creating
> /holding all persistable business objects in the
> system??? 

Yes. The system is the "root" of all these objects, it
needs to hold references to all other persistent
objects in the system.

Exactly how the system does this doesn't matter. For
example we've just finished porting a *big* system
built on EJB (about 150 different EJBs) into
Prevayler/Nanning. In this case the system-object held
a list of "home"-objects (similar to EJBHomes) and
each "home"-object held a list of objects belonging to
that home. (Interestingly enough the performance is
amazing even without any indeces or tweaking of any
kind at all, and we've tested it with a
customer-database as big as one gigabyte! Blazing
speed!) This design isn't very nice but it emulated
the EJB-model closely so there was little refactoring
needed.

> I tried to split up the prevaylent system,
> into sub interfaces, sub-implementations but it's
> obvious that nanning requires the 'target' interface
> to contain the creationmal methods (even though it
> extends other interfaces that do so...).

Not sure what "creational" methods you are talking
about. Please clarify.

Myself I don't use the "mixin" feature extensively so
there may be some bugs in it. In that case, let me
know and I'll fix them.

> How have other's approached this? Or is this just
> the
> way to do it? What about multiple prevaylent
> systems/prevaylers?

Is therotically supported but not extensively tested.

> On another topic, Jon ,  on the prevayler wiki you
> were talking about a rollback system you were using
> at
> lecando. Could you expand a bit on that?

It's committed to Prevayler CVS and will probably be
included in Prevayler 2.0.

It basically executes the transaction on a test-system
first to see wheather it works or not. If it works it
executes it on the live system and writes it to the
log. If it doesn't work it rolls back a new
test-system  from the live system.

_____________________________________________________
Gå före i kön och få din sajt värderad på nolltid med Yahoo! Express
Se mer på: http://se.docs.yahoo.com/info/express/help/index.html


-------------------------------------------------------
This SF.net email is sponsored by:Crypto Challenge is now open! 
Get cracking and register here for some mind boggling fun and 
the chance of winning an Apple iPod:
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en