Help on Factory DAO design... S.O.S.

Hi
I have to develop a J2EE application and I have a theoretic question about Factory DAO pattern.
Consider the following scenario:
- I have to use a DAO patterns.
- My database have 120 tables approximately.
- The system have 20 logical modules approximately the can use whichever table.
- I associate a Session Bean with Factory DAO class.
1.- Do I have to implement only one Session-FactoryDao for all the system or one Session-FactoryDao for each logical module.
2.- Can my session contain only one FactoryDao or many FactoryDao (that�s correct?)
3.- I implement only one interface (implClassDao) for the FactoryDao class. Is possible implement many interface for the FactoryDao class?
4.- What design strategy I have to follow?
Thanks and I hope yours answers.
Isra.

Implement one factory for each of the logical modules. This is an advice and strictly an advice. There are more than one way of doing the same thing correctly - I feel the above is the right way, given your situation.
Ironluca

Similar Messages

  • How to generate report from two tables using DAO design pattern?

    Hi,
    Iam using struts with DAO pattern for my application. According to DAO design im creating model class for each table in my database with getter,setter methods. i have no problem when im generating report from one table. but if have i have to join two tables whatis the better way for doing that? is it good practise to create a new model contains properties from both the tables?
    Please help me
    Thanks in Advance
    Rajesh

    Dear Rajesh,
    As per the pattern you are creating equivalent java objects for every database table under consideration in which each db field will become a private attribute and public getter and setter methods.
    If you have to display data from one table the above approach is sufficient enough.
    But in case your database is normalised ..lets take an example of Bank having Branch and Accounts tables. We dont need to repeat the whole information of the branch for every account in that branch. so we prefer to have a branch id in that table....this approach lot of insertion/deletion/updatation anomlies that may exists with the database...
    now lets come back to our topic....we shall create two java objects 1) Branch 2) Account.....
    When ever u just need to display simple report u can do it staright forward,,,,,now if u want to display branch information along with the account information....the two objects just created are not sufficient
    So i suggest u the following approaches
    1) Create an attribute of type Branch in the Accounts Object......
    This shall serve the purpose of displaying the Btranch information
    2) Create a collection object of type ( Vector or ArrayList) which can have objects of Account in the Branch Object,,,
    Now its upto u how shall u fill up the objects with appropriate sql queries.
    The method that i mentioned is followed by Oracle Toplink and Hibernate ....which provide Object to relation mapping layers.
    Any queries ...revert back to me...
    Mahesh

  • Questions on DAO design

    This is the first time I used DAO design.
    I have a machine class and each machine has a few parts.
    How should I design the DAO? Especially regarding the inner parts.
    Should I create a DAO for machine and for part and put the PartDAO as an atribute of MachineDAO so that I can populate the Machine's parts with the help of PartDAOOr is it better to retrieve the parts directly when retrieving machine by JOINING the 2 tables (inside MachineDAO).
    Or are there other best practices regarding DAO design?
    Please help me,
    Thx in advance,
    David Limanus

    Right sorry. When you think from the user of the DAO
    yes, one DAO should deal with one object. Then when
    you start implementing the DAO, You will try to
    reduce the overall number of tables. I don't agree - the number of tables should be designed according to the data's needs and normalization rules, and the objects according to the problem's needs. Then you map one to the other. I don't understand what you mean by "reduce the overall number of tables".
    But its true
    that I may have 3 different DAOs that access the same
    table. Meaning that one may access the table directly and others JOIN to it? Yes.
    Also, that I have one DAO that uses multiple tables.Meaning JOINs? Yes.
    Actually what I tried was to handle one table from
    one class file. That didn't really work
    either because of the joins and subqueries.
    Inefficient by design: suffers from the (n+1)query
    problem.Could you explain that problem? It seems to work
    well for me and is easily managed.If you measure the performance and find that it meets your service level agreement, then it "works". But it depends on the number of Parts a Machine has, right? If you do one query for each Part, that means one network roundtrip for each one. As the number of Parts gets large, so does the number of network roundtrips. Since network latency is one of the biggest bottlenecks in your app, the more of them you do, the worse your performance.
    A Machine that requires a small number of Parts might perform fine, but if the number increases you might find that performance is unacceptable. Maybe yours is "working well" because your Machines are simple.
    %

  • Could someone explain the Factory Method Design Pattern

    Hi Experts.
    Could someone please explain for me the Factory Method Design Pattern. I read it a little and I understand that it is used in JDBC drivers but i'm not clear on it.
    Could someone explain.
    Thanks in advance
    stephen

    Basically, you have one class that's sole purpose is to create instances of a set of other classes.
    What will usually happen is you have a set of related classes that inherit from some base class. We'll say for example that you have a base class CAR and it has sub-classes FORD, GM, HONDA (sorry Crylser). Instead of having the user call the constructors for FORD, GM, and HONDA, you can give the user a Factory Class that will give him a copy. We'll call our factory class Dealership. Inside dealership, you can have a static function :
    public static Car makeCar(String type)
    if(type.equals("FORD")
    return new FORD();
    else if(type.equals("GM")
    return new GM();
    else if(type.equals("HONDA")
    return new HONDA();
    So when the user needs a car, they will just call
    Dealership.makeCar("FORD").
    This is a good way to hide the implementation of your classes from the user, or if you require complex initialization of your objects.
    Another good example of this is in the Swing library. To get a border around a component, you call static methods on BorderFactory.
    Hope this helped.
    Ed

  • Struts using DAO Design Pattern ..?Please give an example..... URGENT......

    Dear all,
    I have to develop an application in Struts by using DAO design pattern ..........
    Please give an example on Struts using DAO...................
    Thank you
    Please

    I'm glad you asked. It means Read The Flaming Manual. That'd be the struts manual by the way.

  • Struts using DAO Design Pattern Tutorail

    Can anybody give me a link for the Struts using DAO Design Pattern tutorial
    sample tutorial

    http://javaboutique.internet.com/tutorials/ApacheDAOs/
    Found by using google: strust dao pattern tutorial
    There are more good links using that search...

  • DAO design pattern & Transaction boundaries

    I am using a tool to generate a JDBC tier that applies the DAO design pattern. However, the generated code is based on "autocommit"-strategy, i.e. there is no conn.setautocommit(false)-statement in the code.
    I have added statement so that I can handle the transaction by myself. The DataAccessObject-implementation class does however close the connection before returning. I would like to execute the commit outside of the DAO-implementation.
    Anyone who have been experiencing the same problem?
    Best regards
    Lasse Bergstr�m

    I'm not sure if I fully understand your question.
    However, we usually implement such a scenario by doing autocommit false on the connection object and then passing it to the DAO. Finally do a commit on the connection in the calling class.

  • DAO Design pattern

    Hi,
    what is the advantages of DAO Design pattern over other design patterns?
    Can anybody tel me

    valooCK wrote:
    NANDA wrote:
    Hi,
    what is the advantages of DAO Design pattern over other design patterns?
    Can anybody tel methe answer is none!
    DAO stands for data access object, it is a non oo pattern, oo is data centric, it makes sense for data to access data. it is something created by poor procedural minds who can never understand what oo is.
    you may occasionary use it as a collection of functionalities or utilities, but thou shalt never use in as a pattern in oop!There are as-yet undiscovered tribes living in the Amazon, who knew you were going to say that
    @OP: Please ignore this troll, he doesn't even understand the very basics of OO, as can be demonstrated in the following thread
    http://forum.java.sun.com/thread.jspa?threadID=5273397&tstart=0
    Just ignore him. He only wants attention. He hasn't got the faintest idea how to write even "Hello World", let alone actually do any OO design

  • Help needed with a design!

    HELP! I need help with designing something!
    IMAGE on this link " http://i1072.photobucket.com/albums/w362/jjnilsson/DSC_0188.jpg "
    i need this patch on the picture to be "remade" in higher definition and the text should be MILF HUNTERS intstead of milf hunter... Anyone that might be able to help me out?
    reson for all this is that its gonna be made to a 30x40cm big patch fitting the back of our Team jackets!
    send me a pm or a mail ([email protected]) if you need any futher info or if you can help me out! I am really thankful for all the help i can get!
    With best regards J. Nilsson, Milf Hunters Mc

    I simply did as i got a tip on FB to do
    quote from adobe themselves on facebook "Adobe Illustrator You might also want to try asking on our forums as there are many people that can help there as well! http://forums.adobe.com/community/illustrator/illustrator_general"
    sry if it was wrong of me, simply thought there might be someone nice out there to give a helping hand
    Date: Tue, 5 Jun 2012 13:41:48 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with a design!
        Re: Help needed with a design!
        created by in Illustrator - View the full discussion
    This really isn't the place to ask for free services.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4467790#4467790
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4467790#4467790. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Illustrator by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Help with Print Layout Designer

    Hi all,
    I'm not sure if I should post this here or not, I already posted it in the Business One Forum.  Moderator(s)  if this is not the proper place please delete it and let me know that it is not the appropriate venue.
    I need some help with Print Layout Designer.  I am running 2005A SP01, and my customer wants a modification to the Sales Backorder Report.  They want to add the column "In Stock" to both the report as displayed on the screen and the printed document.  The report rendered to the screen has the In Stock, but it is not checked as visible.  I check it and In Stock shows up as designed.  The part I am having problems with is the printed document. I opened the PLD from the Backorder Report, and saved it under a different name.  I resized some of the columns in the repetitive area (header and data) to make room for the In Stock column.  I CAN add the text field Instock as free text and enter "In Stock" as the content.  I looked at the "backorder" column in the PLD, and it is a text field with the source System Variable and the variable is 109.  I would assume that all I need to do in my added column is to set the source to System Variable and enter the variable number.  That is the problem; I can't find the variable number for that column.  I looked on the report rendered to the screen with system information on and the variable is "3 #000027825,OnHand".  I looked at the Back Order column of the report rendered to the screen and the variable is "3 #000028725,OpenCreQty".  I found a spreadsheet that is supposed to contain a list of system variables for 2007A, but the document type for this report is BRDR and that document type does not appear in the list of document types in that spreadsheet.  I looked for a similar spreadsheet for 2005A SP01 but didn't find one.  I DID find a document "How To Customize Printing Templates with the Print Layout Designer".  According to that document, I should be able to get the system variable from the report rendered to the screen with System Information turned on.  Can anyone help?
    TIA,
    Steve

    I haven't dealt with this before so I can't be certain, but here are my thoughts.
    The Backordered Qty is probably a calculated field, so that's why it's a system variable. The In Stock is a defined field, so you probably can use the file and field number, OITM, OnHand. I would look at maybe the stock number or description to see how those are setup on the form instead of the backordered qty field.

  • Help needed with Report Design

    Hi All,
    Here is the requirement.
    Period Type(holds 2 values) : Payment and Vested.
    we have field 'Total Days' which is calculated based on "User Selected" Period Type.
    For example, When Period Type is Payment,
    If start date is less than or equal to grant date and end date is less than or equal to vest date, then calculation is (End Date - Grant Date)+1
    If start date is greater than grant date and end date is less than or equal to vest date, then calculation is (End Date - Mobility Start Date)+1 (similarly 2 more if conditions) ...we have similar calculation for Period Type - 'Vested'.
    This Period Type is a multiselect Prompt. How can this be achievable.
    Any thoughts will be greatly appreciated.
    Thanks.

    I simply did as i got a tip on FB to do
    quote from adobe themselves on facebook "Adobe Illustrator You might also want to try asking on our forums as there are many people that can help there as well! http://forums.adobe.com/community/illustrator/illustrator_general"
    sry if it was wrong of me, simply thought there might be someone nice out there to give a helping hand
    Date: Tue, 5 Jun 2012 13:41:48 -0600
    From: [email protected]
    To: [email protected]
    Subject: Help needed with a design!
        Re: Help needed with a design!
        created by in Illustrator - View the full discussion
    This really isn't the place to ask for free services.
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4467790#4467790
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4467790#4467790. In the Actions box on the right, click the Stop Email Notifications link.
         Start a new discussion in Illustrator by email or at Adobe Forums
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Factory / DAO - Adding in a new DAO that is related to other DAOs

    I have a Module (ModX) that can be associated with different modules.
    When you enter the ModX from one of the many modules that you can enter from, I pass in a Module Id and an Associative Module Id.
    The Module ID is passed to a factory which generates the right 'Bridge DAO' class to write the the proper bridge table and retrive module specific info.
    The associatve id is the specific id of the Module Item I am associating ModX to.
    One of the modules I come from (ModA) from has 2 sub modules that I can associate to ModX.
    Now I can not associate ModA to ModX but ModA_sub1 and ModA_sub2 can be associated to ModX.
    The ModA_sub1 and ModA_sub2 can also prepopulate ModX with some data (prePopulateData(ModX).
    Now I am getting requirements where ModA can hold 'default information' that ModX will be populated with if it is entered from ModA_sub1 or ModA_sub2.
    So if it is Entered from ModA_sub1, default info wil be populated from ModA and some additional info from ModA_sub1.
    Up until this point my design has ben pretty simple, A Factory that returns the proper Bridge DAO based on the Module Id and calls prepopulate(modx).
    Now I am in a situation where I may need information from 2 different DAO's.
    What is the best way to incorporate this into my design? Should I have ModA DAO buried in the sub1 and sub2 prepopulate method to help prepopulate the data? Should a new ModADao be created the can also create the proper sub daos?
    Any suggestions would be greatly appreciated.
    Thank you,
    Al

    alzoid wrote:
    I have a Module (ModX) that can be associated with different modules.
    When you enter the ModX from one of the many modules that you can enter from, I pass in a Module Id and an Associative Module Id.
    The Module ID is passed to a factory which generates the right 'Bridge DAO' class to write the the proper bridge table and retrive module specific info.
    The associatve id is the specific id of the Module Item I am associating ModX to.
    One of the modules I come from (ModA) from has 2 sub modules that I can associate to ModX.
    Now I can not associate ModA to ModX but ModA_sub1 and ModA_sub2 can be associated to ModX.
    The ModA_sub1 and ModA_sub2 can also prepopulate ModX with some data (prePopulateData(ModX).
    Now I am getting requirements where ModA can hold 'default information' that ModX will be populated with if it is entered from ModA_sub1 or ModA_sub2.
    So if it is Entered from ModA_sub1, default info wil be populated from ModA and some additional info from ModA_sub1.
    Up until this point my design has ben pretty simple, A Factory that returns the proper Bridge DAO based on the Module Id and calls prepopulate(modx).
    Now I am in a situation where I may need information from 2 different DAO's.
    What is the best way to incorporate this into my design? Should I have ModA DAO buried in the sub1 and sub2 prepopulate method to help prepopulate the data? Should a new ModADao be created the can also create the proper sub daos?
    Not clear.
    Two possibilities.
    1. You are creating object X based on the results of using object Y. The creation part is important there.
    2. Object X is using object Y.
    For possibility 1 you have two options.
    A. Object X explicity uses object Y in the constructor.
    B. Your factory creates Y and passes it to X during creation.
    For possibility 2 that is composition and should be treated as such. Although again you still use the same options. But this case is an explicit composition relationship.

  • Need help in bex query designer

    hi experts ,
    Actually we had a ODS where the KPI's values  for all weeks are present and also the module.
    in the query designer we need to show the targets for respective KPI's modulewise.
    the requirement is
    module-selections
    week no-selection
    targetweek1week2---week3
    KPI1--10090---90--
    90
    KPI2--95-7885-----90
    based on the module selection the targets values should change and also there should not be any restriction on weeks.
    and also exceptions needs to be done for color coding.
    we actually implemented cell defination for getting the above requirement , but here the problem is that we need to fix the  targets and there is arestriction on the weeks . but the requirement should be dynamic i.e, the targets should be configurable and the weeks should not be restricted.
    in the backend ODS all weeks data is present. we just need an idea how to fix these targets and also color coding for the respective KPI's without using cell defination.
    Kindly throw some pointers how to acheive this..
    thanks in advance,
    Madhu

    Hi Madhuri,
      Ur requirement can be done by using a customer exit variable,keeping any sap stand. time characteristics value.
    If u want to define the any selection dynamically,make a new selection with the text variable and call the customer exit variable into it and assaign the corresponding KPI into it and there by u can define the offset value as well.
      for writting the customer exit,u need to contact ur ABAP'er and say the requirement.
    Hope this helps!!

  • Need help to proposed solution design

    Dear Gurus,
    Following question is more towards designing model structure
    My comapny (Group of legal comapnies) corporate structure is as follows
    Corporate Group
         Comapany A
               Division A1
                   Subdivision A1-1
                         Division A2
         Comapany B
               Division B1
                     Division B2
                   Subdivision B2-1
                   Subdivision B2-2
    Each lowest level (divisoon and subdivison ) dealing in different business line and has its own score card which will be casecaded up for division , companies and then group score card,
    Division are holding subdivision , smilarly Comapnies are the holding corsponding divisions and group holding compnies.
    Query 1 :
    If I decided to develop seprate PAS model for each lowest level( subdivision and division) , as well as context then How I will consolidate them to next level , examp. divisional level for Division B2.
    Query 2 :
    If I decided to develop one single PAs model for whole group having one dimension "corporate structure", How can I keep different score card for each lowest level.
    Note : Here I have one more challenge that we have to perform implementation project in blaock-by-block fashion for example , implemenation for only "Subdivision B2-1" and casecade upto group level then include "Subdivision B2-2" and so on.
    Please suggest.
    regards
    Arif

    Arif ,
    Looking at the requirements , I feel that it is better to create all the divisions in one PAS model itself. Creating a single model would help you in the roll up of the data up the dimensional hierarchy . Creating different PAS models would necessitate loading data at various levels and divisions.
    Since you need a scorecard at each level , I suggest you to have a different context for each division/comapany. The overall corporate group can have a separate scorecard. I know that this design is a bit cumbersome , but , the advantage of splitting the scorecard across various contexts, is that , the authorisations can be set at the context level and the users at the bottom levels cannot view the performance of the Corporate.
    Hope this helps ,
    Vijay

  • Need help with installing CS6 Design Standard

    Hi all,
    Bought CS6 Design standard as a download from Currys the other day. I have a list of 4 files to download.
    First one is a PDF to tell me how to activate my student software.
    Second is a download .exe file for design standard
    Third is another .exe for illistrator content installer
    Fourth is another .exe for indesign and incopy content installer.
    I've donwloaded all 4 files and once i've clicked on the two content installers i then click on the design standard .exe file and up comes this error message "the file archive part of adobe cs6 design standard is missing. you need all parts in the same folder in order to extract adobe cs6 design standard. please download all parts."
    As google automatically places all the download items into the downloads folder, I'm assuming I've done the correct thing and placed them all in the same folder.
    I have read that you need to extract a .72 folder or something. however i cannot see that on my downloads list.
    Please could someone help, or is this a case of taking my laptop into currys and demanding someone to help me??

    you should contact your vendor to see where that 7z file is.
    btw, it should not be manually extracted.  the exe will extract the 7z file's contents.
    or you may be able to download from here, http://helpx.adobe.com/x-productkb/policy-pricing/cs6-product-downloads.html

Maybe you are looking for

  • Save dataset as .xls in SQL Developer 3.2.2 on MACPRO

    Hi Folks, I have a question here related to MAC SQL Developer 3.2.2, I need to save a dataset output from a query as .xls and am not able to see the option to save as .xls? and when I enforce to save it as .xls. also, I have no issue when I save as .

  • Disc Utility stuck when partitioning

    My Macbook Pro Retina (Late 2013) gets stuck in internet recovery mode while partitioning. It has said "Preparing to partition disk" for hours without starting. I previously had Windows 8 installed via Bootcamp on the partition which gets stuck. I ha

  • App Store problem - blank screens

    I'm getting blank screens in App Store on my iPad 3 with ios 6 - charts and categories screens are blank. Blank screens also when redirected to a particular app from a web page link. Wife has same iPad and hers works perfectly. Have rebooted, turned

  • Standard output type for Delivery picking list

    Hi All, My requirement is to trigger a picking list from the outbound delivery whenever the overall WM status is "B". Probably I need to look at a new requirement routine to add this condition. Pls tell me what is the standard output type available f

  • Strange bar came up when opening System Preferences

    I saw an Aqua bar whilst opening System Preferences, with "Update:" written next to it. Do I have a virus?