Re: about Business Object and System Object design?
Jon Tirsén <[email protected]> Tue, 29 Apr 2003 16:46:53 +0200 (CEST)
| Newsgroups | gmane.comp.java.nanning.devel |
|---|---|
| Message-ID | <[email protected]> |
Forgot to say: Otherwise everything looks fine. The reason you need to create the object with the factory is for changes to that object to be made persistent. Problem is that everything may look fine the first time you're executing it, but when you restart the system the changes you made have disappeared. --- yiming wang <[email protected]> skrev: > hi jon, > > In nanning's testcase, > I guess that MyObject.java is normal Business Object > > and MySystem.java is to hold all Business Objects. > > I add following code in MyObject.java: > /** > * @transaction > */ > void createNewMyObject(); > > /** > * @transaction > */ > void removeNewMyObject(); > > MyObject getNewMyObject(); > > also MyObjectImpl.java: > > MyObject newMyObject; > > public void createNewMyObject() { > newMyObject = new MyObjectImpl(); > //should be (MyObject) > //Aspects.getCurrentAspectFactory().newInstance(MyObject.class) > //? > > newMyObject.setValue("abc"); > } > > public void removeNewMyObject() { > newMyObject = null; // to remove > //newMyObject from the system, right? > } > > public MyObject getNewMyObject() { > return newMyObject; > } > > then i test it, all is fine. > but in method public void createNewObject(): > newMyObject = new MyObjectImpl(); > is it a right design? > should it be writed as following? > newMyObject = (MyObject) > Aspects.getCurrentAspectFactory().newInstance(MyObject.class); > > if i am not missing, i guess there is only one big > xxxSystem.java in system which > hold all "top level" Business Objects, the "top > level" > Business Object > (like MyObject.java, it is wraped as Aspect object) > can hold other business objects(they may not Aspect > object, > so we can do like that "newMyObject = new > MyObjectImpl()") > > that's all my thought, just about to persistent > framework. > i hope that you can know my said and guide me to the > right way. > > thanks! > > wang yiming > 2003.4.29 > > __________________________________ > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. > http://search.yahoo.com > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Nanning-developer mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/nanning-developer _____________________________________________________ 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:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf