about Business Object and System Object design?

yiming wang <[email protected]> Tue, 29 Apr 2003 07:05:11 -0700 (PDT)
Newsgroups gmane.comp.java.nanning.devel
Message-ID <[email protected]>
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