Re: General design question-nanning/prevayler

saimon <[email protected]> Wed, 12 Mar 2003 00:07:22 +0100
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
Hi  Jon,

See inline

Jon Tirsén wrote:

> --- 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.
>
Good. I wasn't comfortable with the idea of one class having to create 
all bo objects.

>
>  
>
>>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.
>  
>
Excellant, so I can have a SystemRepository/SystemRepositoryImpl proxy 
which holds a system wide repository,
containing my customer & order repositories. Then just add to the 
repositories.

>  
>
>>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.
>

Sorry for the confusion I just meant things like factory methods etc...

>
>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.
>  
>
What I was actually refering to is that I tried to create a  
SystemRepository/SystemRepositoryImpl proxy
 where SystemRepository extended OrderRepository which extended 
ProfileRepository which extended IdentifyingSystem (Similarly for the 
impl.). But this did not provoke the persistance most probably because 
the persistant methods I  was trying to call existed on either 
Order/ProfileRepository but not in the actual 'main' interface  
(SystemRepository) used to create the 'proxy'.

>  
>
>>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.
>
I will test this out (This is my own pet project so I can afford to play 
around ;)

>
>  
>
>>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.
>
I'll take a look...

Thanks....

I'll let you know how it goes... ;)

>
>_____________________________________________________
>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
>_______________________________________________
>Nanning-developer mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/nanning-developer
>
>  
>

__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com


-------------------------------------------------------
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