Menu

#3 Inner classes generation failure

0.2.*
open
Pino
features (6)
7
2009-06-02
2009-06-02
No

The generation process fails with inner classes as it generates pages and classes omitting the container class name. This can be a naming only error unless you have naming conflict like I had in my project where I have Purchase$Detail and Bill$Detail (two distinct classes) but running the generator I obtain DetailAction.java, DetailActionTest.java, DetailFactory.java and DetailFactoryTest.java generated twice.... obviously the latter (Purchase$Detail) overwrites the former (Bill$Detail).

The same happens for JSPs (detail-edit.jsp, detail-list.jsp, detail-view.jsp, detail-list-dialog.jsp and detail-edit-dialog.jsp), within struts.xml (doubled actions and forms declarations) and forms.xml (doubled detail-form entries). A similar problem occurs on the Domain class where we have doubled findDetail, listDetails and other methods doubled.

I suggest to adopt a convention and when we find an inner class we name all relative files as OuterClassInnerClass which produces an output like:

BillDetailAction.java
BillDetailActionTest.java
BillDetailFactory.java
BillDetailFactoryTest.java
PurchaseDetailAction.java
PurchaseDetailActionTest.java
PurchaseDetailFactory.java
PurchaseDetailFactoryTest.java
bill-detail-edit.jsp
bill-detail-list.jsp
bill-detail-view.jsp
bill-detail-list-dialog.jsp
bill-detail-edit-dialog.jsp
purchase-detail-edit.jsp
purchase-detail-list.jsp
purchase-detail-view.jsp
purchase-detail-list-dialog.jsp
purchase-detail-edit-dialog.jsp

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.