2 Replies Latest reply on Jun 19, 2009 7:45 PM by Binesh Gummadi

    App architechture question

    Alex Cougarman Apprentice

      I'm building a Seam app that will have a number of form pages. The information collected on each page includes name, phone, and email but also has other fields unique to that type of person. Some of the pages include: NewEmployee, Supervisor, and Requestor.


      Should I create a Person superclass that has name, email, and phone properties then extend it for each page? What's the best approach with respect to Seam? Thanks.


        • 1. Re: App architechture question
          Chris Simons Expert

          That is certainly a good option to simply extend the Person class.


          One thing to consider is that there are several ways of going about this with Seam when using JPA.  You could, for example, embed the subclass information by using a discrimator.  Or you could setup a parent to child relationship in the database.  A number of options, really.


          You could get fancy and create a facelet for entering the generic person data and then include this facelet on each page for Supervisor, Requestor, etc.

          • 2. Re: App architechture question
            Binesh Gummadi Novice

            It really depends on your application logic.





            1. Can one person be a NewEmployee, Supervisor, and Requestor? I would use a person super class with its own table.

            2. If they are unique and if you are just trying to extract the common fields then I would use embeddable.

            3. What should your database tables look like to fullfill your usecases? Read this



            Good Luck