Hi guys,
I'm going to vacation for 2 weeks.
After this I'm back and have time to test/fix
everything and develop new stuff.
XDocletgui will need to talk to loader to be able
to find correct xtags.xml for modules.
I also would like to propose new usefull pattern
for EJB inspired by some swing techniques.
I call it "EJB Owner". Basically it consits of
interface "<EJB name here>Owner" which has jus one
method "get<Put EJB name here>" so it looks like:
---<snip>---
package com.db.cfc.bo.Category;
import com.db.cfc.bo.Category.interfaces.*;
import java.rmi.RemoteException;
import javax.naming.NamingException;
import javax.ejb.FinderException;
/**
* interface for objects which own category object
*/
public interface CategoryOwner {
public Category getCategory() throws
RemoteException, NamingException,FinderException ;
}
---<snap>---
Abstract EJB class having 1 relationship to category
bean may choose to implement this.
Second class for this is OwnerSuppoert:
---<snip>----
package com.db.cfc.bo.Category;
import com.db.cfc.bo.Category.interfaces.*;
import javax.naming.NamingException;
import javax.ejb.FinderException;
import java.rmi.RemoteException;
/**
* interface for objects which own category object
*/
public abstract class CategoryOwnerSupport implements
CategoryOwner {
/**
* utility object
*/
private CategoryHome _categoryHome = null;
/**
* obtain category home interface
*/
protected CategoryHome getCategoryHome() throws
NamingException {
if(_categoryHome == null) {
_categoryHome =
CategoryUtil.getHome();
}
return _categoryHome;
}
/**
* return category PK object. shall be
implemented elsewhere
*/
protected abstract CategoryPK getCategoryPK();
public Category getCategory() throws
RemoteException, NamingException,FinderException {
return
getCategoryHome().findByPrimaryKey(getCategoryPK());
}
}
---<snap>----
Both ow those classes can be generated.
Somebody who wishes implement this pattern has do
something like:
private CategoryOwner _co;
in constructor:
_co = new CategoryOwner() {
public CategoryPK getCategoryPK() {
return new CategoryPK(getCategoryId());
}
};
And of course has to implement interface method :
public Category getCategory() {
_co.getCategory();
}
I used this in my project, and it does work.
regards,
=====
Konstantin Priblouda ( ko5tik ) Freelance Software developer
< http://www.pribluda.de > < play java games -> http://www.yook.de >
< render charts online -> http://www.pribluda.de/povray/ >
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com
_______________________________________________________________
Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -
http://devcon.sprintpcs.com/adp/index.cfm?source=osdntextlink
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel