UML, associations and persistence of data

Well, while studying UML (just started) I came across the following problem. I think it's something that has a very simple answer for someone with a medium knowledge of UML and OO.
So, suppose I want to model an Employee-Company class association. Each employee works for 1 company, and, of course, a Company has 1..* Employees. If I model this simple class association using a UML tool the following Java code is generated.
public class Employee {
    public Company company;
public class Company {
    public java.util.Collection employee = new java.util.TreeSet();
}Of course in a real scenario, the association between a Company and its Employees should be persistent, with Employees residing on a DB. I have seen a lot of such examples (i.e. School-Student, Gym-Customer.....).
What's the way to really implement such things?
Generally speaking how are class associations with a "more than 1" multiplicity at one of the ends of the relationship implemented?
Thanks in advance.

cleanzero wrote:
yawmark wrote:
cleanzero wrote:
Ok, so suppose that we all agree, without entering into specific details, that a DB is needed, in terms of UML how is this represented?In what, a class or sequence diagram? It isn't. The class (or object) that interacts with the database, however, could be.
~At class level. Is it, as I've done, a Employee * <-> 1 Company association?That's one way. It all depends on your problem. Sounds like that is correct for your case.
Your object model for the business process doesn't have to know or care whether or not objects persist. Get the classes, relationships, and sequences right first. Persistence can be added later.
%

Similar Messages

  • UML associations and code generation don't work

    Hello,
    I've maid a Class Diagramm in JSE 8, class generation works great, but I have a problem with associations : they are not generated (ie no attributes in class files). I've tried to give association name and also named both ends, but nothing better.
    Thanks for your help.
    PS : navigable association seems to work great.

    Thanks for your valuable feedback and sorry for the inconvenience.
    I already submitted a request for enhancement (RFE) for automatic code generation for Association links. As for the documentation issue, I'm not able to replicate your problem. I'm seeing all comments in the source that I entered in the documentation panel. Could you please kindly provide me detail steps to reproduce the case that you don't see documentation generated in the code and I'll try to help you. Thanks!
    --Peter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • I have an older ipod 80gb that I've just reset and associated with my iTunes account.  It's recognized and up to date but when I sync I can't download any of my music.  How can I download my iTunes library to this device?

    I have an older ipod classic 80gb that I've just reset and associated with my iTunes account.  It's recognized and up to date but when I sync I can't download any of my music.  How can I download my iTunes library to this device?

    Hello Analogue guy living in wireless world,
    Thank you for providing the details of the issue you are experiencing when trying to sync your music to your iPod.
    I recommend trying to sync your music again using iTunes.  When you have your iPhone connected to iTunes, I recommend checking the Music tab to verify that Sync Music is checked.  From here, you will be able to select to sync your "Entire music library" or "Selected playlists, artists, albums, and genres:"
    I recommend reviewing the full article here:
    iTunes 11 for Mac: Set up syncing for iPod, iPhone, or iPad
    http://support.apple.com/kb/PH12113
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • How to set a default start and/or end date for New Events based on trigger date.

    I'm using the CalendarActivityListener to get current row when clicking on an existing event. As per previous posts this listener gives you access to event detail including Start Date, End Date, etc.
    However, what I want to do is to default the start (and end) dates for New Events based on the trigger date.
    I've tried the CalendarListener and can grab the Trigger Date from it - however, I can't see a way to pass this directly to the popup/dialog I'm using to create the new event.
    At present I'm putting the TriggerDate into the ADFContext session scope e.g. ADFContext.getCurrent().getSessionScope().put("TriggerDate",calendarEvent.getTriggerDate());
    Then, I've tried multiple approaches to try and "get" the TriggerDate from session scope to drop it into my new Calendar Event basically, I'm trying to default the InputField(s) associated with the Start Date using the value from the session - I've tried
    1. setting the default value for the InputField in the jspx using a binding expression i.e. value="#{sessionScope.TriggerDate}" - this actually sets the value appropriately when the jspx is rendered but, when I go to create I get a NPE and I can't debug. I assumed that it might be a Date type issue - it would appear that CalendarListener provides a date of type java.util.Date and that the StartDate attribute of my VO/EO/table is a DATE and therefore requires oracle.jbo.domain.Date so I tried casting it - to no effect
    2. Using a Groovy expression *(StartDate==null?adf.context.sessionScope.TriggerDate:StartDate)* in my calendar's EventVO to default the Start Date to the same result
    Any thoughts or ideas?

    John,
    Thanks for that suggestion - could not get it to work. However, I did manage a different approach. I finally determined the sequence of events in terms of how the various events and listeners fire (I think).
    Basically, the CalendarActivityListener fires, followed by the listener associated with the Calendar object's Create facet, followed finally by the CalendarEventListener - the final is where the TriggerEvent is available and then finally, control is passed to the popup/dialog in the Create facet. So, my approach of trying to set/get the TriggerDate in the user's HTTP session was doomed to failure because it was being get before it had been set :(
    Anyway, I ended up adding a bit of code to the CalendarEvent listener - it grabs the current BindingContext, navigates through the DCBindingContainer to derive an Iterator for the ViewObject which drives the calendar and then grabs the currently active row. I then do a few tests to make sure we're working with a "new" row because I don't want to alter start & end dates associated with an existing calendar entry and then I define the Start and End dates to be the Trigger Date.
    Works just fine. Snippet from the listener follows
    BindingContext bindingContext = BindingContext.getCurrent();+
    *if ( bindingContext != null )    {*+
    DCBindingContainer dcBindings = (DCBindingContainer) bindingContext.getCurrentBindingsEntry();+
    DCIteratorBinding iterator = dcBindings.findIteratorBinding("EventsView1Iterator");+
    Row currentRow = iterator.getCurrentRow();+
    if ( currentRow.getAttribute("StartDate") == null)+
    currentRow.setAttribute("StartDate", calendarEvent.getTriggerDate());+
    if (currentRow.getAttribute("EndDate")==null)+
    currentRow.setAttribute("EndDate", calendarEvent.getTriggerDate());+
    *}*

  • Persistence of data in J2ME mobile device using RMS

    Hi. Just want to ensure that RMS can let us store some values in the mobile device. I'm using emulator to try this out. Everytime i close the emulator, the data stored in the RecordStore's gone. How about in real mobile device?
    For some reasons, my jad and jar can't be installed in my Nokia 6210. It keeps giving me "Invalid Jar file" error.
    So, my main question is whether RMS really stores the value in the mobile device and can be retrieved everytime that MIDlet app's run again.
    The other question is why is it that my jar can't be installed in my Nokia 6210? I just built it with NetBean with J2ME and it could be run on the emulator perfectly.
    Thanks a lot.

    Hi. For the installation to my phone, i have solved it by changing my app's MIDP version 2.1 to 2.0.
    For the persistence of data part, i changed the Storage->"Storage Root Directory" to "\save" in Preferences of SJWTK and re-run my app on the emulator and my phone. However, it seems that the record store's data is not persisted. So, i assume it has something to do with my code. My code is as below. Can anyone give me some clues on what i have done wrong? Thanks.
    public TheConstructor(MIDlet midlet, Form form, int partnerId){
         try
          // The second parameter indicates that the record store
          // should be created if it does not exist
            rs = RecordStore.openRecordStore(REC_STORE_NAME, true );
            if (rs.getNumRecords() == 0) {
                RecordIdParam = getAdsParam();
                if (clientIdParam.length > 0) {
                    clientId = RecordIdParam;
                    writeRecord(RecordIdParam);
                    readRecords();
                    closeRecStore();  // Close record sto
            else {
                readRecords();
                closeRecStore();  // Close
         catch (Exception e)
          db(e.toString());
    private void db(String str)
        System.err.println("Msg: " + str);
      public void closeRecStore()
        try
          rs.closeRecordStore();
        catch (Exception e)
          db(e.toString());
       public void writeRecord(String str)
        byte[] rec = str.getBytes();
        try
          rs.addRecord(rec, 0, rec.length);
        catch (Exception e)
          db(e.toString());
      public void readRecords()
        try
          // Intentionally make this too small to test code below
          byte[] recData = new byte[5];
          int len;
          System.out.println("num of records is " + rs.getNumRecords());
          for (int i = 1; i <= rs.getNumRecords(); i++)
            if (rs.getRecordSize(i) > recData.length)
              recData = new byte[rs.getRecordSize(i)];
            len = rs.getRecord(i, recData, 0);
            RecordIdParam = recData;
        catch (Exception e)
          db(e.toString());
      }

  • Sharepoint 2013, Infopath 2013 and SQL List Data Connection

    I created one list library in SharePoint 2013
    Customized with info path forms 2013 …
    External data connection with SQL servicer table
    SQL table fields are associated with List fields…
    I converted data connection in to UDC file and uploaded in the Data connection Library in SharePoint 2013
    I published the list… when I new document I am getting an error …
    You do not have permissions to access a database that contains data required for this form to function correctly.
    An entry has been added to the Windows event log of the server.
    Log ID:5566
    Correlation ID:
    0bb79b9c-3893-20d2-21e3-d428b2f4e92f
    Hai

    Hello , 
    Please refer below threads .
    http://social.msdn.microsoft.com/Forums/en-US/6bead079-4a71-49aa-9c67-ad59069a0ffe/sharepoint-2010-infopath-form-error-you-do-not-have-permissions-to-access-a-database?forum=sharepointcustomizationprevious
    http://blogs.technet.com/b/rajbugga/archive/2013/08/07/infopath-over-claims-authentication-sharepoint-2010-amp-2013.aspx
    Also I would suggest you to create a simple web service to get and update the data to database . And use that Web service to your DB operations . 
    Best Regards Kuldeep Verma
    Please remember to click "Mark As Answer" if a post solves your problem or "Vote As Helpful" if it was useful. 

  • How do I get rid of 97] in Cookies and other website data

    When I open Preferences/Privacy and select "Details" under "Cookies and other website data" the first entry which pops up is
                 97] plug-ins
    If I highlight this entry and click remove, It is removed for perhaps 10 seconds, and then re-appears in the list.
    1- What is this?
    2- How do I get rid of it?
    This is clearly a prvacy issue, or Apple would not be listing it in this listing with the associated warning.

    Linc Davis wrote:
    Log out, then log back in while holding down the shift key after you enter your login password. Keep holding until the desktop appears. That will prevent third-party add-ons from loading. Try again to delete that item.
    If you still can't delete it, and you still want to, proceed as follows.
    Back up all data if you haven’t already done so. Before proceeding, you must be sure you can restore your system to the state it’s in now. If you skip this step, no one but you will be responsible for the consequences.
    Quit Safari if it’s running.
    Step 1
    Select /Applications/Safari in the Finder and open the Info window. There’s a checkbox in that window labeled “Open in 32-bit mode.” If that box is checked, uncheck it. Close the window.
    Hold down the option key and select Go > Library from the Finder menu bar (Lion) or open the Library subfolder of your home folder (pre-Lion). Delete the following items from the Library folder (some may not exist):
    Caches/com.apple.Safari
    Caches/Metadata/Safari
    Saved Application State/com.apple.Safari.savedState
    Leave the Finder window open. Try Safari again.
    Step 2
    If it still doesn’t work right, quit, go back to the Finder, and move the following file to the Desktop:
    Safari/Bookmarks.plist
    Then delete the following items (some may not exist):
    Cookies/Cookies.binarycookies
    Cookies/Cookies.plist
    Preferences/com.apple.Safari.LSSharedFileList.plist
    Preferences/com.apple.Safari.plist
    Preferences/com.apple.Safari.RSS.plist
    PubSub/Database
    Safari
    Try again. This time Safari should perform normally, but your settings will be lost. Select File > Import Bookmarks from the Safari menu bar. Import from the bookmarks file you moved to the Desktop. Recreate the rest of your Safari settings. You can then delete the old bookmarks file.
    Note: This step will remove your Safari Extensions, if any, and their settings. If you choose to restore them, do so one at a time, testing after each to make sure you haven’t restored the problem.
    If you don’t like the results of step 2, you can undo it completely by quitting Safari and restoring the items you deleted in that step from your backup, overwriting any that were created in their place. You don’t need to restore the files you deleted in step 1.
    Ok... completed step1 with no change.
    went on to "part of "step 2...
    I kept the Bookmarks.plist, but then deleted the assortment of safari related Caches and Cookies
    Cookies/Cookies.binarycookies
    Cookies/Cookies.plist
    (I found several entries in Cache, but forgot to write down which ones I deleted ... sorry.)
    did not delete any of the preferences or the last two entries in your list above.
    Tried again and "the perp" was still there. "Remove all" on the Details tab did not change things...
    However, there were now only 2 entries -- the 97] AND my bank's entry (Chase)!
    Going back to the main privacy tab and clicking "Remove all Website Data" this time DID remove the last two entries.
    =====
    Now when I open the details tab, (I run my own webserver as my home page) Safari showed ONLY the cache entry for my server, no cookies.
    However, I then noticed something quite intersting.
    I left the details tab open and pulled to the side (the joy of having a 27 inch iMac) and naviaged to Apple.com
    and then to support and then logged in to here.
    As I was doing this. the Details window first showed, "Apple.com" .. Cache, Cookies, Local Storage
    but then virtually immediately poped up entries:
    doubleclick.net ... Cache
    edgekey.net ... Cache
    google.com ... Cookies
    Very interesting, both from the point of view that "details" was showing me what was happening in "real time."
    And the fact that, even with zero external ads, the web site, Apple.com, was inserting entries in the cache for doubleclick.net and edgekey.net. I can "almost" understand the "google.com" cookie, ecept for the fact that the search engine selected in the tool bar is "bing."... as I said "interesting."
    With this new "insight" on the Details screen, It may be possible to determine WHERE this 97] actually came from. However, I would still like an explanation of what it actually is.... since the "]" (right square bracket) character is evidently a "special character" for search engines -- google, Yaho and Bing all treat it the same way -- they ignor it.... even when the entire 3 character string is quoted -- "97]" -- the pages returned all are for entries with only 97 in them.

  • How do you generate uml diagrams And decoding java programs

    1)Hi i have neatbeans 5.0 i have finished witting my code and i wanted to know if there is a way to generate uml diagrams straight from the code.
    2) Also i think i have bought a java programme to improve your memory and i wanted to know is there a way you look in the java sorce code so i can change the settings the file has a dynamic.dll(application extension), a level(dat File) and a unins000(dat file)

    Darryl.Burke wrote:
    Also i think i have bought a java programme to improve your memory
    Did you remember to install it?I don't think his memory goes back that far :)

  • UML: Composition and its implementation aspect?

    UML: Composition and its implementation aspect using a Nested Class (Is it always or depends or is there another equivalent way?)
    1. I read this thread: http://forum.java.sun.com/thread.jsp?forum=425&thread=306033&start=0&range=15&hilite=false&q=
    2. Now, basically I want to understand:
    a. If a nested class is NECESSARILY a form of composition? Or it depends on the meaning of the presented code and/or the meaning of the requirement?
    b. When there is a composition, should we ALWAYS model it using a nested class and in which case/scenario/example, the choice of nested class is justifiable AND mandatory?
    c. Is there any example that the Composition can be implemented by nested class (es) as well as non-nested class? (Equivalent way)
    d. Depends on c., if there is a choice between a nested class and non-nested class? Which is better and from what angle?
    3. 1M Thanks.

    When you say nested class, I interpret that as a Java inner class.
    If that's true, then I don't think that composition is always modeled as an inner class. It's more likely to be a simple private data member that's a public class type.
    I usually see composition as a non-nested class. In his "UML Distilled", Martin Fowler says aggregation is the part-of relationship. Composition is a stronger variety of aggregation, where the part object may belong to only one whole and lives and dies with the whole.
    So if you have a Polygon class that has a Collection of Points as member data, that's composition. No inner classes in sight. - MOD

  • Extraction and loading of Training and Event Management data (0HR_PE_1)

    hello,
    I've got the following doubt:
    before BI 7.0 release, extractor 0HR_PE_1 extracts event data (eventid, attendee id, calday,...) but if you load straight to cube 0PE_C01, as Calendar year/month needs a reference date (for example, event start date), you'll get total duration of event in hours or days refered to event star date.
    So in a query filtered by month, you get total duration of an event that starts in the filtered month but it couldn`t end until few months later o year later, so you don´t get appropiate information.
    Example:
    Event          calday        Hours
    10004377  20081120   500        but from event_attr event end date is 20090410.
    In a query filtered by 200811 you get total duration time (500 hours when in 200811 event hours have been 20) or if you filter by any month of 2009 you don´t get information of duration of that event.
    I had to create a copy of standar cube (without calday, only Calendar year/month, Calendar year in time dimension) and disaggrate data creating as many entries for an event as months lasts and adjust calculation of ratios duration of event (duration of event in each month/ total duration of event).
    The question is: Is there any improvement or change on business content in BI 7.0 to treat Training and Event Management data? Has anybody had to deal with that?
    Thank you very much.
    IRB

    Hi,
    TEM data is stored in HRP tables.
    You can load the catalog by creating LSMWs for objects Business event group (L), Business event types (D), Locations (F), Organizers (U) as per requirement.
    LSMW for tcode PP01 can be used to create these objects.
    To create Business Events (E) you can create LSMW for PV10/PV11.
    To book attendee create LSMW for tcode PV08 as here you can specify the actual business event ID which reduces ambiguity.
    tcode PV12 to firmly book events
    tcode PV15 to follow up
    Hope this helps.
    Regards,
    Shreyasi.

  • Training and Event Management Data Load

    Hello Team
    Would appreciate if any of you can advice on how to load Training and Event management data. I think its stored in HRP tables.
    I'm working on an upgrade assignment.
    Thanks

    Hi,
    TEM data is stored in HRP tables.
    You can load the catalog by creating LSMWs for objects Business event group (L), Business event types (D), Locations (F), Organizers (U) as per requirement.
    LSMW for tcode PP01 can be used to create these objects.
    To create Business Events (E) you can create LSMW for PV10/PV11.
    To book attendee create LSMW for tcode PV08 as here you can specify the actual business event ID which reduces ambiguity.
    tcode PV12 to firmly book events
    tcode PV15 to follow up
    Hope this helps.
    Regards,
    Shreyasi.

  • How can I get my data back after a family member hacked into my iphone and replaced my data

    A family member hacked into my iPhone and replaced my data with his own data. I am afraid to plug it into iTunes for fear of overwriting my backup. iCloud probably already overwrote. Can I restore the phone without synching first, and then use Time Machine to get back to an earlier backup and re-synch?

    Over two years and no spsonse to this? will there be any point me asking the same?

  • In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    In oracle rac, If user query a select query and in processing data is fetched but in the duration of fetching the particular node is evicted then how failover to another node internally?

    The query is re-issued as a flashback query and the client process can continue to fetch from the cursor. This is described in the Net Services Administrators Guide, the section on Transparent Application Failover.

  • Difference between sy-datum and any given date

    Dear Friends;
    I have one query  regarding DATE  I wanna calculate the difference between
    SY-DATUM and ANY GIVEN DATE . Is there any function or code available that take one parameter as sy-datum and another parameter as any given date and give result as no. of days between them
    Regards;
    Parag

    DATA: DATEDIFF TYPE P.
    CALL FUNCTION 'SD_DATETIME_DIFFERENCE'
      EXPORTING
        date1                 = '20071122'
        time1                 = '000001'
        date2                 = '20070905'
        time2                 = '000001'
    IMPORTING
       DATEDIFF               = DATEDIFF
    EXCEPTIONS
       INVALID_DATETIME       = 1
       OTHERS                 = 2.
    Greetings,
    Blag.

  • Web Analytics reports and not showing data

    Recently we are not seeing Web Analytics data on our sites in our SharePoint 2010 farm. Before we used to see the data. This is what we are seeing now "There is no data available for this report. Here are some possible
    reasons: (1) Web Analytics has not been enabled long enough to generate data;
    (2) There is insufficient data to generate this report; (3) Data logging
    required for this report might not be enabled; (4) Data aggregation might not be
    enabled at the level required for this report."
    I checked the Web Analytics Service Application and it is started. Web Analytics Data Processing service is started on all servers.
    Microsoft SharePoint Foundation Usage Data Import Timer job is running every 30 minutes, while Microsoft SharePoint Foundation Usage Data Processing job is disabled. Does this job has to be
    enabled for the web analytics data to be reported? Are there any other places to check to debug the problem? Appreciate any help.
    rani

    Hi Rani,
    The timer job Microsoft SharePoint Foundation Usage Data Processing needs to be enabled, as it will aggregates and writes the data to the Web Analytics Reporting database.
    Please enable this timer job and run the timer job to see how it works.
    More reference about this error:
    https://timreemtsma.wordpress.com/2011/10/25/sharepoint-2010-web-analytics-no-data-available/
    Thanks,
    Victoria
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

Maybe you are looking for

  • Why is my button width 1?

    Ok I'm officially confused. Why is the width of my button 1 and height 28 (when it should be  237 x 51)? It seems to be interfering with multiple buttons I have in my other animations. Here's the button... http://twistedpancreas.com/edge/misc/btnRoll

  • IPod videos now only show audio

    I have an IPod 80 gig video (Black) and for some strange reason my videos are now audio. If I were to play them via ITunes they'll show as video, but on the IPod it only plays audio. Even more odd, if I were to do a search on XP for .mp4 files it no

  • How to resolve: "Update server not found (check your internet connection)"?

    When doing Help / Check for Updates, I get "Update server not found (check your internet connection)". This has been the case for 6-8 weeks or longer but auto update worked fine before. Not sure if something changed on my MacBook Pro. If so, I can't

  • Nokia Lumia 800 Backup power

    Hi! Do Nokia have any official Backup power or Portable power device with could be used in Lumia 800. If not, what 3rd party device (or what kind of device) they would recommend to use with 800. -Juho

  • Authentication Domain for PeopleTools 8.48

    I know there is very little reason to change the authentication domain name; however, there are situations where the issue may arise when this needs to be done. In 8.48, how do you change this without having to totally rebuild the weblogic 8.1 webser