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.

Similar Messages

  • Applications that can relate to other phones

    Hi, I have a n8 phone that I just bought last year. It frustrates me cause just few months after I bought It a newer version was out in the market. I am also hoping that nokia could have applications similar to other phone makers just like for Samsung and phones. That have similar applications so you could connect to social network and can edit photos easily.(just like instagram and viber something like that)  As I observe the applications available in our store is exclusive to nokia users only except for the Windows phone. Hope you could have available updates for phone like mine. That not even a year old but seems like on a phase out stage already.

    Back up your iPhone and restore from backup. If that's does not help, restore your iPhone as new (not from backup).

  • Chainged password on ipad and phone now cant accsess itunes store on either device if i reset to factory settings and put in new password will that work

    have i pad and phone chainged password now not able to accsess apps store on either device if i reset to factory settings and enter new password will that solve problem?

    If you only changed your password - not your Apple ID - have you changed it in the settings? Settings>Store>Apple ID - tap the ID and you can make changes in there.
    You should not have to reset to factory Settings so don't resort to that just yet.

  • 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

  • I erased all the contacts, apple ID and icloud account in my old 4s and gave it to someone. However, whatever contact that someone has saved in my old 4s phone has added in my new 5sphone. Does anyone know how to solve this?

    I erased all the contacts, apple ID and icloud account in my old 4s and gave it to someone. However, whatever contact that someone has saved in my old 4s phone has added in my new 5s phone. Those are not my contact and I don't want them in my new phone. Does anyone know how to solve this problem?

    Ln the old iPhone, -> What to do before selling or giving away your iPhone, iPad, or iPod touch

  • I thought as a consumer, Apple works for us.  Had I known what I'd lose by upgrading, I would have thought twice!!!  I want Front Row BACK!!! also what is this new playlist that was auto added when I upgraded?  It's called iTunes  Artwork screen?

    I thought as a consumer, Apple works for us.  Had I known what I'd lose by upgrading, I would have thought twice!!!  I want Front Row BACK!!! also what is this new playlist that was auto added when I upgraded?  It's called iTunes  Artwork screen? 

    Think the iTunes artwork playlist is for a new screensave they put in where if you click the album artwork it plays the song.

  • HT1386 I unplugged my iphone while it was syncing with itunes and now it will not sync new music that I have added to itunes? How can i fix it?

    I unplugged my iphone while it was syncing with itunes and now it will not sync new music that I have added to itunes?

    iPhone User Guide
    The Basic Troubleshooting Steps are:
    Restart... Reset... Restore from Backup...  Restore as New...
    Restart / Reset
    http://support.apple.com/kb/ht1430
    Backing up, Updating and Restoring
    http://support.apple.com/kb/HT1414

  • I bought my wife an ipad for xmas and the machine is faulty the apple authorised dealer admitted it was faulty and wants to replace my new machine with a factory refurbished unit. I told them that i will only accept a new one? am i right?

    i bought my wife an ipad retina for xmas and the machine is faulty, it keeps on switching off. the apple authorised dealer admitted it was faulty and wants to replace my new machine with a factory refurbished unit. I told them that i will only accept a new one as it is only a few weeks old and had the problem from the begining? is it correct that apple replaces new defective products with factory refurbished one? I have used apple products most of my life from mac 2 to G5. I had over a dozen apple machines and never had a problem so far? I do not believe this is right..

    architectmartin wrote:
    In the EU there is also a mandatory two year warranty by european union law. I am not a lawyer but i never signed or agreed to any apple policy at the time of purchase, i was told you have a two year guarantee bring it back if anything goes wrong which i did and now i am being quoted all sorts of policies. my own policy is that if you buy new you get new, with no excuses.  I feel a bit cheated by apple if i have to compromise with a second hand unit. the unit is not even a month old and we took it to the original store a couple of weeks after it was bought and they sent us to take it to a servicing dept in another town. I am an apple fan and expect excellent service like the products themselves.
    No one ever does sign anything - the purchase itself, where you exchange money for the product, is your de facto agreement to all warranties and policies set forth by both the seller and the OEM supplier.  That's a pretty firmly established principle of consumer law (image the nightmare if you had to read and sign to such things every time you purchased anything or everything?).
    You can complain to the store or to Apple about it if you wish.

  • How do I get rid of the new toolbar that was added by versions 20 and 21?

    I have tried both versions 20 and 21 and both have the bugs below so I ended up having to re-install version 19:
    1.) Versions 20 and 21 add a new toolbar that has nothing but a "Firefox" button on it - and no way to get rid of this toolbar is provided. It wastes far too much space on my laptop's screen - that button should have been put on one of the other toolbars or simply made part of the icon set that users can use to customize their menubar or other toolbars.
    2.) That new toolbar is not customizable. Hence, I don't have the option of recovering screen space by moving everything from my menubar onto the new toolbar then hiding the menubar.
    3.) The back, forward, and stop|reload buttons on my menubar no longer work. Moving them back to the navigation toolbar and showing that toolbar does not solve the problem. Nor can I right-click on a web page and select those functions from the context menu: they are permanently disabled there too.
    4.) I can no longer right click on the menubar or a toolbar and get a context menu from which you I can pick a "customize" option - I can't get a context menu AT ALL. In order to customize things for versions 20 or 21, I first have to reinstall version 19, do the customizations, then reinstall version 20 or 21.

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can also check for problems with the localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

  • Transferring old data to new iPod -- will it remove new apps that come with my new one?

    My old iPod Touch is a 2nd generation, IOS 4.2.1, and I now have an iPod Touch 4th generation arriving with either IOS 5 or 6.
    I want to transfer my game apps progress -- which I don't want to lose!! --  from the old device to the new device, and I've found out from these discussions that I need to make a backup then restore from backup to the new device, treating it not as a new device.
    But does this mean that all the new-to-me app features that come pre-loaded on my 4th generation will be wiped out in the process?
    Obviously the 4th generation comes with things my 2nd generation never had, and needless to say I want those to still be there when I add all my old games and other apps.
    Can anyone assure me that in the "restore from backup" to my new device, everything from my old iPod will be added to my new one, but won't replace and or wipe out of existence any new features already loaded on my new iPod?
    My priorities/worries are:
    Not losing any game progress in the transfer,
    But also not losing any newer factory-loaded apps or features on the newer iPod, in the transfer.
    Thanks for any assistance.

    Thank you lllaass, this is reassuring!
    So the "restore" adds to what's on the new iPod, not throws it all out/replaces -- good to know. Many thanks.

  • WHY VERIZON TOOK AWAY A SECOND UPGRADE TO REPLACE A  BRAND NEW PHONE THAT WAS DEFECTIVE

    I have had a cellular account for many years with Verizon. I currently have three (3) lines on my account. (removed), which is my phone, (removed), which is my husband’s phone, and (removed) which is my son’s phone.
    I upgraded my phone to the Ipone 4 in 2012 under my son’s line (5841), so this line should be eligible for another upgrade this year.
    In April 2014 I upgraded my husband’s phone under my line (9835). We originally upgraded to the Moto X, and I was charged the $35.00 upgrade fee. Unfortunately the Moto X had multiple issues and your tech support could not figure out how to fix the bugs so they replaced the first Moto X with a second one, that still had issues, so we were sent a third one, but Tech Support couldn’t get the phone activated. Since we went through three (3) Moto X’s and your Tech support admitted this phone is known for certain issues, a supervisor overrode the 14 day return rule and allowed us to choose a different phone for the upgrade. My husband wanted to go back to the Droid Maxx, which is what he originally had and loved. I had to pay $99.00 for this phone. The supervisor had to get my permission to extend my contract under this line (9835) an additional two (2) months since we were switching the original upgraded phone to a different one and I of course agreed, whats another two (2) months. I was not charged $35.00 a second time.
    When I went on line to see when the (5253) line would be eligible for upgrade so I can upgrade my Iphone that is now two (2) years old and starting to have serious issues, I saw that this line is not eligible until August 2016, which means your company is claiming we already did an upgrade for 2014 which WE DID NOT.
    On August 25, 2014 my husband called tech support about the Droid Maxx as it was having DATA issues, it would not send or receive pictures and kept saying Data Error. Tech Support did a hard reset, which did not fix the problem. It also stopped taking pictures and a few other problems with it so Tech Support sent us a new Droid Maxx under the manufacturer’s warranty since the phone is under one (1) year old. But Apparently whoever put in the order put it in as a upgrade happening on August 25, 2014. When I called to get this straightened out, I was advised that on May 20, 2014 we upgraded to the Droid Maxx so this line is not eligible for upgrade until May 2016. I tried to explain this was NOT an upgrade it was an override of the 14 day return rule to allow us to change the upgraded phone to the Droid Maxx since the original upgrade phone the Moto X had multiple issues that could not be fixed by your company. I am now being told that I autherized a second upgrade under the 5253 line for the Droid Maxx which is NOT TRUE. I would never have authorized an upgrade for a second line to replace a BRAND NEW PHONE that was an upgrade on the 9835 line. That makes no sense whatsoever. It was not our fault that the Moto X is a phone that has issues that is no fault of ours, so why should I be punished and have an upgrade taken away from me in order to replace a Brand New Phone that didn’t work?
    I talked to customer service two days ago and promised a call back to resolve this in 24-48 hours, but I never got a call back.
    I have been a loyal customer of Verizon since I have been out on my own. I had Verizon landline for many many years and went to Verizon Wireless when they became available. I have talked many many friends into switching to Verizon because their customer service has always been top notch and I always felt like this company cared about its customers. But to have this happen just has me speechless.
    As I explained above, my phone needs replacing very soon as it is two (2) years old. I can’t get voice messages that are clear, it drops calls, even with full bars, it doesn’t ring half the time when someone calls me. I have been told on numerous occasions that someone has tried to call me but it went straight to voice mail, but my phone is always on, it showed no miss calls, nor did it ever ring so the calls aren’t even going through. It has had a hard reset a few times, but the issues are just getting worse. I am not going to upgrade under my son’s line 5841 in November because I am not going to extend his contract for two (2) more years. He has an old flip phone that is four (4) years old and if that phone goes up, how will he be be able to upgrade if I have to use his upgrade?
    I am asking that you please look into this matter and correct this upgrade issue. The 5253 line should be eligible for an upgrade now, not in 2016.
    Thank you for your assistance in this matter. If you need to contact me you can try calling my cell at (removed). (If the call will go through)
    Thank you
    (removed)
    Looks like US Cellular has a promotion going on where they will buy out my contracts if I go with them.  Guess I will be leaving Verizon since they refuse to do the right thing.
    >> Personal information removed to comply with the Verizon Wireless Terms of Service <<
    Message was edited by: Verizon Moderator

    shoostar, I'm sorry this had to occur on your new phone. In your post, I show you were heading back to the store to exchange your device. Please let us know if the store reps were able to resolve your issue or if they simply exchanged the phone. When a customer has an issue with an application, we always first recommend removing the application off the phone. If you are able to remove the app and still have issues or are not able to remove the app, the second suggestion is a master reset. I have listed both options below for your convenience.
    Steps to remove an application below:
    Note: Applications included with the Android Operating System may not have an uninstall option.
    From the home screen, select the App menu.
    Select Settings.
    If the application icon is missing, select App menu filter (located at the top) then select All apps.
    Select Applications.
    Select Manage applications.
    From the All tab, select an application.
    Select Uninstall.
    Select OK.
    Select OK.
    Steps below to perform Hard/Master Reset:
     Note: Performing a hard reset will remove ALL data including the Google account, system data, application data, application settings, and downloaded applications. 
    From the home screen, select the App menu.
    Select Settings.
    If the application icon is missing, select App menu filter (located at the top) then select All apps.
    Select Privacy.
    From the Personal data section, select Factory Data Reset.
    Select Reset phone.
    If presented, enter the current passcode or draw the unlock pattern.
    Select Erase Everything.
    Allow up to 3 minutes for the factory data reset and reboot processes to complete, then perform initial activation and setup.

  • Our benefit administrator keeps getting an error on adding a social security number that starts with a 9, that is a valid SSN for a spouse, How do we allow this to go through?

    Our benefit administrator keeps getting an error on adding a social security number that starts with a 9, that is a valid SSN for a spouse, How do we allow this to go through?

    To attempt a new chat session...
    For the link below click the Still Need Help? option in the blue area at the bottom and choose the chat option...
    http://helpx.adobe.com/x-productkb/global/service1.html

  • How do I play videos on my new mac that wont show in Quick Time?  windows media player

    I just got a new imca - switching from a pc.  When I receive attachments etc that are not formatted for Quick Time, I can not open and play the video.  IS there some other software that I need onmy new Mac that will allow this?  Or is there some other configuration to the Mac's current configuration that I should be using? 

    First read this: Adding additional media format support to Quicktime:
    http://support.apple.com/kb/HT3526
    Download and install (or re-install even if you already had them) the latest versions, suitable for your flavor of Mac, of:
    RealPlayer SP for Mac from:
    http://www.real.com/realplayer/mac
    Flip4Mac WMV Player from  http://www.telestream.net/flip4mac-wmv/overview.htm  (Windows Media Player for the Mac is no longer supported, even by Microsoft)
    Perian from  http://perian.org/
    You should read this support page  http://perian.org/#support   in case you need to delete older codecs.  In Macintosh HD/Library/Quicktime/ delete any files relating to DivX (Perian already has them), particularly any DivX extension to Safari. However it should be noted that Perian is not an internet plugin and will not play DivX files imbedded on a website. For that you will need the DivX Player browser plugin available from  http://www.divx.com/en/software/mac/player

  • In the photos app I have 2 camera rolls and 1 photo gallery. Each new photo that I take gets stored in one of the camera rolls, but when I back up the photos to my computer it only backs up the one camera roll, and not any of the new picks. Please help

    In the photos app I have 2 camera rolls and 1 photo gallery. Each new photo that I take gets stored in one of the camera rolls, but when I back up the photos to my computer it only backs up the one camera roll, and not any of the new picks. In the one I backed up I have 500 plus photos and the other over 1000. I need to back up the 1000 one- camera roll. Any help would be sincerely appreciated. Help .... Please

    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    - Reset all settings  Already sugested
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up           
    - Restore to factory settings/new iOS device.
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar          

  • How do I remove a page that Aperture made on its own? I made a 20-pp. book, but Aperture added a p. 21 that cannot be edited or deleted. Even Apple store people could not figure it out. P. 21 has 5 or six images I used as a kind of template.

    I made a book and eventually settled on the 20-page minimum size. I also made a kind of template of one page with 5 or six images and copied-and-pasted them on new pages as a starting point. That bunch of images is now on p. 21 (which should be blank), and no image can be edited in any way, either singly or in a group. They can't be selected, moved, deleted, or otherwise affected. Apple Store people were equally unable to do anything. We tried adding pages in various places, but nothing would let us get rid of p. 21 or any part of it. We also tried copying the book and starting anew on the copy. Didn't work. Suggestions?

    Try this -
    <img src="assets/jpgs/Prodigy Logo Large 2014.jpg" width="180" height="180" alt="" style="display:block;">
    What you are seeing as whitespace is the space reserved for glyph descenders on any element that is rendered within a text box (i.e., an inline element). By making the image "display:block" you eliminate that space because a block element doesn't have descenders. If that works to your satisfaction then you can give the logo an id, and create a CSS selector containing that block style.

Maybe you are looking for

  • How can i change my account id/email on my iphone for icloud??  it won't allow me to update it

    how can i change my account id/email on my iphone for icloud??  it won't allow me to update it despite that it already has been updated online through both itunes and icloud.  HELP!!

  • Authorisation issue(very urgent)

    Hii all, My client has asked to create a new user-id and to give a few authorisation of reports to it.Could anyone help me regarding this ASAP. Till now I have identified the required reports & the data targets connected to it.Just help me to proceed

  • Spam contact requests

    I have had a Skype account for several years, I have never had so may spam contact requests as in recent months. I have the highest privacy settings and always report and block spam. It still comes through - often with the same photos and message req

  • Wrong add_child info at table actions in Querybuilder at Apex 4.x

    I found it in Apex4.0 (but not reported) and found same behaviour in Apex4.0.1 If you use qurybuilder for joined tables (create sql) you choose a table then click on "table actions"box and you will get add_parent, add_child. This works fine for DEMO_

  • Parameters in Transformations file "data export"

    Hi, i'm trying to export to a txt file data from SAP BPC to a txt file, using the standard package (Export Transactional Data). I have several issues. Firstly, it seems like the dataexport generates a lot of lines containing all the "PARENT" calculat