I think the best way to find out if your approach is reasonable is to try it and see if it works. ;-)
Matt On 12/1/07, Mani_N <[EMAIL PROTECTED]> wrote: > > > Please let me know what am thinking is a good approach or not? And please > let me know if there are any better approaches for achieving > this............ > > > > Mani_N wrote: > > > > > > Thanks Matt. > > > > I am thinking of following below approach for a project we are going to > > start. Please let me know if this approach wont make any problems in > > future or is there any better approach of achieving this. > > > > 1. Identify all the entities and their relations(like one-to-many, > > many-to-one etc.) > > 2. Create the entity POJO classes > > 3. Create a Spring MVC modular pattern using appfuse archetype > > 4. Place the POJO classes in core module and run appfuse:gen on each of > > the entity POJO > > 5. Run mvn install > > 6. Move to web directory and again run appfuse:gen on each of the entity > > POJO > > > > The customizations I need is screen layouts, screen designs and some > > business processsing.......... > > > > So for business processing am thinking of writing a simple POJO > > class(Advice) with methods for business validations or preprocessing > > before save method and using this Advice methods using aop:before and > > aop:after advices in applicationContext.xml of core module so that this > > wont disturb the application generated by appfuse. Is this a better > > solution or do u ahve any better suggestion. > > > > And for screen layout and screen design changes am thinking of writing our > > own pages and then using the appfuse tag libs to access the objects. Will > > this be good approach and will it be that easy? can u suggest a more > > better approach if there is any? > > > > > > > > mraible wrote: > >> > >> You shouldn't need to generate DAOs, Managers, etc. for the child. If > >> you're managing the object from the parent, you should be able to use > >> the Parent's DAO for everything. If you do end up needing a DAO and > >> Managers for the child, you don't need to write Java code to do that > >> - you can do it easily enough just by writing Spring bean definitions. > >> > >> Hope this helps, > >> > >> Matt > >> > >> On Dec 1, 2007, at 10:48 AM, Mani_N wrote: > >> > >>> > >>> > >>> So how about dao's and manager's that are generated by appfuse:gen > >>> for 2 > >>> related entities (like parent and child) Will they have support for > >>> this......... > >>> > >>> Suppose Memotype is Parent and Memorandum is child > >>> > >>> How to write a sample test case in core module to test > >>> Memorandum.getMemotype().getMemoTitle() value? > >>> > >>> Please help... > >>> > >>> > >>> mraible wrote: > >>>> > >>>> Comments below... > >>>> > >>>> On Dec 1, 2007, at 3:06 AM, Mani_N wrote: > >>>> > >>>>> > >>>>> Hi, > >>>>> > >>>>> Environment Used: > >>>>> Maven: 2.0.7 > >>>>> Pattern: Spring MVC Modular > >>>>> Appfuse: 2.0.1 > >>>>> Java: 1.5 > >>>>> Database: MYSQL > >>>>> Persistence Framework: Hibernate > >>>>> > >>>>> > >>>>> I have two tables with following structure...... > >>>>> > >>>>> CREATE TABLE `memotype` ( > >>>>> `memoTitle` varchar(255) NOT NULL, > >>>>> `memo_desc` varchar(50) default NULL, > >>>>> PRIMARY KEY (`memoTitle`) > >>>>> ) ENGINE=InnoDB; > >>>>> > >>>>> CREATE TABLE `memorandum` ( > >>>>> `fromPer` varchar(255) NOT NULL, > >>>>> `to_person` varchar(50) default NULL, > >>>>> `memoTitle` varchar(255) NOT NULL, > >>>>> PRIMARY KEY (`fromPer`), > >>>>> KEY `memoTitle` (`memoTitle`), > >>>>> CONSTRAINT `memorandum_ibfk_1` FOREIGN KEY (`memoTitle`) REFERENCES > >>>>> `memotype` (`memoTitle`) ON DELETE CASCADE > >>>>> ) ENGINE=InnoDB; > >>>>> > >>>>> Am creating entities using appfuse:gen-model. Am getting the two > >>>>> entities > >>>>> but by default am getting id generators on top of get methods of > >>>>> primary > >>>>> keys whereas they should not be auto generated values. Anyway am > >>>>> removing > >>>>> those generator strategies from the primary key fields and using > >>>>> appfuse:gen > >>>>> in core and web modules for generating the code. > >>>>> > >>>>> The test cases were failing in web module, so i used - > >>>>> Dmaven.test.skip=true > >>>>> while mvn install > >>>>> > >>>>> And given the command mvn cargo:start -Dcargo.wait=true for starting > >>>>> the > >>>>> tomcat........... and opened the browser. > >>>>> > >>>>> I was expecting a combo box for memoTitle in memorandumForm.html > >>>>> screen to > >>>>> select memoType from memoTypes which are already there. But there is > >>>>> no > >>>>> field memoTitle at all in that screen. It has only two fields > >>>>> fromPer and > >>>>> toPer. > >>>>> > >>>>> Did appfuse doesnt have support for parent child relationships? > >>>> > >>>> No, not in appfuse:gen. It's a feature we'd like to add, but we need > >>>> more knowledge to do so. If you know what the pattern might look like > >>>> - you're more than welcome to modify the FreeMarker templates to > >>>> produce the code you're looking for. We recently added the ability to > >>>> customize templates in your project for AMP. If you change your > >>>> appfuse-maven-plugin to version 2.0.2-SNAPSHOT, you should be able to > >>>> extract all the templates from the AMP JAR to src/test/resources/ > >>>> appfuse and your templates will be used instead of the ones in > >>>> AppFuse. > >>>> > >>>> > >>>>> And is there > >>>>> a way to specify to consider all entities in com.mycompany.app.model > >>>>> package > >>>>> like "*" in appfuse:gen instead of using appfuse:gen for each entity > >>>>> in > >>>>> application? > >>>> > >>>> No, but you could probably modify the code to do this pretty easily. > >>>> Here's a link showing you how to get the AMP plugin from SVN. > >>>> > >>>> http://tinyurl.com/27set9 > >>>> > >>>> Matt > >>>> > >>>>> > >>>>> > >>>>> > >>>>> > >>>>> -- > >>>>> View this message in context: > >>>>> http://www.nabble.com/Is-it-possible-to-use-parent-and-child- > >>>>> entities-with-appfuse-tf4927572s2369.html#a14103452 > >>>>> Sent from the AppFuse - User mailing list archive at Nabble.com. > >>>>> > >>>>> -------------------------------------------------------------------- > >>>>> - > >>>>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>>> For additional commands, e-mail: [EMAIL PROTECTED] > >>>>> > >>>> > >>>> --------------------------------------------------------------------- > >>>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>>> For additional commands, e-mail: [EMAIL PROTECTED] > >>>> > >>>> > >>>> > >>> > >>> -- > >>> View this message in context: http://www.nabble.com/Is-it-possible- > >>> to-use-parent-and-child-entities-with-appfuse- > >>> tf4927572s2369.html#a14107687 > >>> Sent from the AppFuse - User mailing list archive at Nabble.com. > >>> > >>> --------------------------------------------------------------------- > >>> To unsubscribe, e-mail: [EMAIL PROTECTED] > >>> For additional commands, e-mail: [EMAIL PROTECTED] > >>> > >> > >> --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > > -- > View this message in context: > http://www.nabble.com/Is-it-possible-to-use-parent-and-child-entities-with-appfuse-tf4927572s2369.html#a14112843 > Sent from the AppFuse - User mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]