Association Relastionship between classes

I am new to Java Programming.
If I had two classes
Customer { }
And
Account { }
How can I make this:
One Customer can have many Accounts
"A customer object is associated with many Account objects"
One Customer can have ONLY ONE Account
"A customer object is associated with ONE Account objects"

One Customer can have many Accounts
"A customer object is associated with many Account
objects"class Customer {
List accounts; // List of Account object
One Customer can have ONLY ONE Account
"A customer object is associated with ONE Account
objects"class Customer {
Account acccount; // one account

Similar Messages

  • Ternary Association In a class diagram

    Hi
    Please help. I need to depict a ternary association icon between 3 Classes in my Class diagram.
    I am using Java Studio Enterprise 8's UML tool.
    The modeling palette does not make provision for this type of association.
    Is there a way to depict the ternary association icon, or is there an update for the Modeling palette in the class diagrams?
    It is the little diamond, looks the same as the decision icon.

    I filed one for neext release http://www.netbeans.org/issues/show_bug.cgi?id=79744
    It's unlikely functionality will be added in patch to jse8.

  • What is the differene between class diagram and er diagram .....pls ex

    what is the differene between class diagram and er diagram .....pls explain with examples

    <b>Diff btw Class Diagrams and ERD's:</b>
    Class diagrams and ERDs both model the structure of a system. Class diagrams
    represent the dynamic aspects of a system: both the structural and behavioural features.
    ERDs, depicting only structural features provide a static view of the system.
    Elements of a class diagram:
    >class
    >association
    >binary
    >n-ary
    >Aggregation
    >Composition
    >Generalization
    >Dependency
    >Realization
    >Association Classes
    Elements of Entity Relationship Diagrams:
    >Entity - A data attribute is a property common to an entity.
    Check this link
    www.cdf.toronto.edu/~csc340h/summer/tutorials/TutorialClassERD.pdf
    Regards,
    Pavan.

  • Custom Events and Listeners between classes

    I've got a project I've been working on for weeks that I'm
    having yet another problem with. I'm trying to learn AS3 which is
    why it's taking so long but that's not important for this post.
    I wanted to create a custom event class so that I could make
    sure the event does not interfere with other "COMPLETE" events that
    are being passed between classes. In other words, I have a few
    things that need to complete prior to a function being called...
    one is some XML being loaded and another is a font loaded. So, I
    thought I would create a custom FontLoaded class that extends Event
    and make the type something like "FontLoadedEvent.LOADED". That way
    I could listen for the XML "Event.COMPLETE" and this font event
    also.
    Please tell me if I'm going down the wrong path here but I
    don't seem to be getting the dispatched event for my new custom
    event. Also, how does one detect if it's being dispatched other
    than if the eventListener is fired? Any other ways to test
    this?

    You can trace the event to see if it dispatched.
    Also, this is not a good case to create a new event. Custom
    events are used to store additional information. MouseEvent exists
    because Event doesn't have localX, localY, etc. properties. Since
    you don't seem to be throwing additional properties, you can use a
    regular event.
    trace(dispatchEvent(new Event("panelFontsLoaded"));
    addEventListener("panelFontsLoaded", onFontsLoaded);
    Static consts are used to help debug typos. The event type is
    just a string, often stored in a const.

  • Problem in file association and main-class in JWS

    Hello , all
    I have a problem in JWS with file association and main-class. I have a java application that has two entry classes, one is appmain.class that is required to launch from web, and the other is player.class that is required to launch when user double-click the .abc extension file.
    In JWS 5.0+, there is a association element in JNLP syntax that can be used to make the file association with .abc extension. But how can I declare the main-class in JNLP file?
    If I declare the application-desc element as <application-desc main-class="player">, the player.class will be launched from web. But if I declare it as <application-desc main-class="appmain">, the .abc extension wil be associated to the appmain.class.
    Does anyone know how to solve this problem? Thank you for your kindly help.

    One way is to define a third main that refers
    to the other two, as appropriate. E.G. if the
    web based main does not include -open as
    its arguments, it is easy.class WebStartSpringboard {
      /** Call web based main unless args include -open. */
      public static void main(String[] args) {
        if (args[0].equals("-open") ) {
          OpenFileBasedClass.main(args);
        } else {
          WebBasedClass.main(args);
    }Other measures might be taken for a situation
    where the web based version does include a
    -open argument.

  • Is there any Similar between Class.forName() and new operator ???

    Plz tel me is there any Similar between Class.forName() and new operator ??? i have been asked this ques in interview

    You probably should have used the other thread:
    http://forum.java.sun.com/thread.jspa?threadID=792678
    To add a little confusion to the matter...Class objects are in fact objects. They're objects representing classes. So, in a sense, I guess, you could say they're similar -- in each you get an object. But in practice Class objects and all other objects should be considered semantically different unless you're doing some pretty unusual stuff. Also Class.forName is more of a factory method than a constructor.

  • Diffrence between Class.forName() and new Operator

    What is diffrence between class.forName() and new operator.Please tell in much detail.
    Also about classloader.loadclass.
    Suppose the class that we are tring to load with the help of class.forname is not compiled. Again if I make changes at runtime to that class will that get reflected.

    What is diffrence between class.forName() and new
    operator.Please tell in much detail.Class.forName loads a class. The new operator creates a new instance. Apple trees and apples.
    Also about classloader.loadclass.Read the API.
    Suppose the class that we are tring to load with the
    help of class.forname is not compiled.Then you can't load it and get an exception. Read the API.
    Again if I
    make changes at runtime to that class will that get
    reflected.Depends on the changes and when exactly you do them.

  • Controlling events between classes

    hello
    i know i'm asking a lot, but i couldn't find anything. the problem is i've got a jframe and some panels with buttons.
    eg:
    class A extends JFrame
    getContentPane().add( B ) ;
    getContentPane().add( C ) ;
    class B extends JPanel
    add( button1 ) ;
    add( button2 ) ;
    class C extends JPanel
    add( button3 ) ;
    add( button4 ) ;
    where do i add ActionListeners? how do i pass information between classes? if button1 is clicked -> class A should know it.
    i tried to do this in class A: objectOfB.button1 (access button1 directly) - didn't work - why?
    if a button1 is clicked i want to remove the jpanel and replace it with another one. how should i do this?
    Thank You All

    Check out the java tutorials. There are great examples that show you how to do what you want to do

  • Link between Class and characteristics created for that class

    Hi All,
    Is there any table that I can look at to find a link between class and the characteristics created for that class. For all the list of characteristics created I am refereing to CABN table but my requirement is to find the logic to see all the characteristics created for a class. Can anyone suggest me the right table to look at?
    Regards,
    Shane

    Hi,
    I would like to thank you for your quick response. So based on your thoughts, here is the process i followed to find the characteristics for a existing class,  took the Internal class number and used the KSML table to find all the Characteristics created for that class.
    To find the list of values assigned to that characteristics, used the AUSP table for that characteristics internal number.
    Thank you again for your inputs
    Shane.

  • What is the fundamental difference between classful and classless routing?

    Hello to all,
    After reading several RFCs, guides and HOWTOs I am confused by an apparently trivial question - what is the basic, fundamental difference between classful and classless routing?
    I am well aware that - said in a very primitive way - the classful routing does not make use of netmasks and instead uses the address classes while the classless routing utilizes the netmasks and does not evaluate the address classes.
    However, already in 1985 the RFC 950 (Internet Standard Subnetting Procedure) stated that the networks can be further subnetted using the network mask. Since then the routers are expected to use network masks in the routing decision process in the precise way they use it nowadays. However, if the routers use network masks they are doing the classless routing, aren't they? Where is then the difference if we used to describe the 80's way of routing as a classful routing? Or was it already the classless routing? The RFCs about CIDR came gradually only in 1992 and 1993.
    If somebody could give me an insight into the key difference between classful and classless routing (and perhaps into the Internet history, how was the real routing done then) I would be most grateful.
    Thank you a lot!
    Regards,
    Peter

    Hello Mohammed,
    I am afraid we still have not understood each other ;) I am not looking for the algorithms used to select the best path. I am well aware of them, both Ford-Bellman and Dijkstra, and about their internals. By the way, these algorithms do not have any influence whether the routing is classful or classless because they deal with metrics, not with masks. For example, a classless EIGRP internally uses a distance-vector algorithm, not a SPF algorithm.
    I will try to explain once more what is my problem... There are two terms commonly used but badly defined: the classless routing and classful routing. Originally, I have thought that the classful routing works as follows:
    - The routing table consists only of classful destination networks (major nets), metrics and respective gateways. No network masks are stored in the table because we are classful, that is, we use exclusively the route classes and all entries in the routing table are already classful.
    - When routing a packet, the router looks at its destination IP address and determines the major net of this IP address (that is, the classful network that this IP address belongs to). Then it looks up the corresponding entry in the routing table and sends the packet to the respective gateway.
    I thought that the classful routing works in this way. I won't describe the classless routing - both of us know how do the today's routers select the next hop.
    However, in the RFCs 917 and 950 which were published in 1985, long ago before the term 'classless routing' was coined, the network mask was already defined and it was stated how the routers should work with it.
    Now I am confused. The terms classless addresses and classless routing were defined sometime in 1990's, therefore I assume that the routing before the invention of classless IP assignment can be in fact described as classful. In other words, I thought that the routing that was commonly used in 1980's did not use netmasks and can be described as classful because the notion of classlessness came first in 1990's. But now I see that netmasks were defined in 1985.
    Now where am I wrong? Do I understand the classful routing properly as I described it? Is it correct to talk about routing in that era as classful although the netmasks were already in use? Or was it already the classless routing?
    Basically I am trying to understand what was called the classful routing if the classless routing is said to be something different.
    Mohammed, I am most grateful to you for your patience and suggestions! Thank you indeed.
    Regards,
    Peter

  • Difference between class 200 and 300

    Experts,
    Can i use class 200 for varient configuration?
    I want to know difference between class 200 and 300 , are this same?
    Appriciate help.
    Tom

    Thanks for marking thread useful.
    Class 300 and 200 are both defined for the materials.class 300 is mainly used for a variant material used for variant configurartion.We can also classify materials under class 200 which do not have to be configurable materials.But allows to use the defined characteristics and restrict the usage for a specific purpose..
    Please check below threads
    http://scn.sap.com/thread/631073
    https://scn.sap.com/thread/576848
    Yes you can copy class and create your new class .
    can you please share your business requirement, what kind of solution your are budiling with this?
    Thanks
    Ritesh

  • Can Papyrus show a list of all Associations of a Class?

    Hello
    Suppose I am working on a Class Diagram and I would like to have a list of all associations that a Class participates in, within the scope of the model.
    Or I am working on a Use Case Diagram and I would like to have a list of all Use Cases that a specific Actor participates in within the scope of the model.
    It would need to be real time by clicking on a view, not generating a report and looking thru it.
    Is my understanding correct that this cannot be done in papyrus? Or maybe one can define a Profile that would support this functionality?
    Thanks for any info.

    Hi Ri Fr,
    What you are looking for is a query, so a profile would not help.
    In as far as I know, there is currently no such explicit query. There is actually little related to traceability reporting (of which your request is an aspect) within the tool at this point.
    However, all the information for both explicit and implicit traceability queries is in the model, so it should be possible to create such a query as you want using existing customization capabilities of the tool.
    Although I am not familiar with it, Papyrus can also show model information as tables - perhaps there is a way to get to the information that way. But someone more familiar with that capability would have to chime in.

  • Communication between classes ???

    Hi
    I am facing problems in establishing communication between java classes.
    My application consists of 4 java classes in following sequence.
    Sockets main() of java UI called JavaUI calls execute class;s func Execute()
    Client ---------------------� server---------------------------------------- -� java UI appln ------------------------------------------------------------------� execute button.
    When execute button is clicked ANT tools are called and executed. I want some mechanism by which my execute class notifies my java UI application about the successful completion of execution, which in turn tells my server and then server should acknowledge client about the same.
    How can I achieve this back ward communication in java.
    Message was edited by:
    javaUser10

    i have written a swing application in which does program does the following.
    1. Server Application (can be deploy on the server)
    a. checks an engine if it is still working by checking the database every minute
    b. if not working sends a string of message to a dedicated port
    2. Client Application()
    a. retrieves messages from the dedicated port
    b. engine has been stopped, client application can start the engine
    maybe you can do the same for your application

  • Link between classes: Reference Error

    Hi,
    I am still trying to create a movie clip array to make a list of objects appear on stage and have the user interact with them.
    This will be my game loop class called "LetterArray()".
    My main class is called "BugGoopFSGame()".
    After I add the line of code below into my LetterArray(). as class file I get the error message below:
    Code entered:
    private var  lettersL1:Array = new Array[a,f,g,h,i,n,o,s,t];
    This is the error message I get:
    ReferenceError: Error #1069: Property [object T] not found on S and there is no default value.
        at LetterArray()
        at BugGoopFSGame()
    I am sure the reference I use between the two files are not good. Can you please tell me what code I should add and where.
    Thanks for your help!
    Charine
    This is the code in my main class - BugGoopFSGame()
    package
        import flash.display.*;
        import flash.utils.Timer;
        import flash.events.*;
        import flash.events.MouseEvent;
        import flash.media.Sound;
        import flash.events.Event;
        import flash.media.SoundChannel;
        import flash.media.SoundMixer;
        import flash.media.SoundTransform;
        import flash.text.*;
        import flash.net.URLRequest;
        public class BugGoopFSGame extends MovieClip
            public var mybackground:BackGround;
            public var letterArray:LetterArray = new LetterArray(stage); //this is how I link from main to gameloop
    This is the coce in my gameloop class - LetterArray()
    package
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.utils.Timer;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.net.URLRequest;
        public class LetterArray extends MovieClip
            private var _stage:Stage; //this reference works well to the main file. Should I somehow link it to the errorous code below?
            /*Movie clips that need to go into an array    */
            //level 1
            public var a:A = new A();
            public var f:F = new F();
            public var g:G = new G();
            public var h:H = new H();
            public var i:I = new I();
            public var n:N = new N();
            public var o:O = new O();
            public var s:S = new S();
            public var t:T = new T();
            private var letterArray:Array;
            private var  lettersL1:Array = new Array[a,f,g,h,i,n,o,s,t]; //this is the line that causes the error. I am sure it is because I need to add something to the main class.

    if, for example, A is a class name, you should use "A" and then use getDefinitionByName() to retrieve the class reference from the string.
    private var  lettersL1:Array = new Array['A','F','G','H','I','N','O','S','T'];
    for(var i:int=0;i<lettersL1.length;i++){
    var C:Class=Class(getDefinitionByName(lettersL1[i]));  // import flash.utils.getDefinitionByName
    var c:*=new C(); // create instances from the classes in lettersL1
    // do whatever with c
    or, move those instanciation statements into your LetterArray constructor or somewhere beyond like:
    package
        import flash.display.*;
        import flash.events.*;
        import flash.text.*;
        import flash.utils.Timer;
        import flash.media.Sound;
        import flash.media.SoundChannel;
        import flash.net.URLRequest;
        public class LetterArray extends MovieClip
            private var _stage:Stage; //this reference works well to the main file. Should I somehow link it to the errorous code below?
            private var letterArray:Array;
            private var  lettersL1:Array; //this is the line that causes the error. I am sure it is because I need to add something to the main class.
            public function LetterArray(ss:Stage):void{
                var a:A = new A();
                var f:F = new F();
                 etc
                lettersL1 = [a,f,...]
                _stage = ss;

  • Problems navigating between classes

    Hi again,
    Sorry to be such a bore; situation is as follows:
    1)I have a midlet class containing an inner class where I can merrily navigate between a Form and a Canvas class
    2)I've written a separate class, which also extends Canvas – not an inner – which I can navigate to but cannot get back to either the form or the inner canvas class
    3) How do I do it? :-)
    Cheers
    J
    And here is the outer class
    public class OtherCanvas extends Canvas implements CommandListener{
       public Command form02 ;
       public Canvas myCF;
        public OtherCanvas(){
           //myCF = new CanvasForm();
           form02  = new Command("Form", Command.SCREEN, 1);
           this.addCommand(form02);
        protected void paint(Graphics g){
          int w = getWidth();
          int h = getHeight();
          g.setColor(159,182,205);  //159;182;205
          g.fillRect( 0,0,w,h );
        public void commandAction( Command c, Displayable d){
            //if (c == form02)
    }

    Hi,
    Trying to get to first base(with midlets) has made me forget my basic java. Anyway i have now done what you said (which i should have known) and i must be close, but still unable to navigate back to form from OtherCanvas
    Ok here's the code:
    J
    public class OtherCanvas extends Canvas implements CommandListener{
       public Command form02 ;
       public CanvasForm myCF;
       private Display display;
       private Form form;
       public OtherCanvas(Display disp, Form fm){
           display = disp;
           form = fm;
           form02  = new Command("Form", Command.SCREEN, 1);
           this.addCommand(form02);
           this.setCommandListener(this);
        protected void paint(Graphics g){
          int w = getWidth();
          int h = getHeight();
          g.setColor(159,182,205);  //159;182;205
          g.fillRect( 0,0,w,h );
        public void commandAction( Command c, Displayable d){
            if (c == form02)
               display.setCurrent(form);
    }

Maybe you are looking for

  • Ipod touch 4G wont sync with itunes 10.7

    I updated the Itunes software from 10.6 to 10.7 and now my ipod wont sync any new songs I put on my playlist, I can see all of the songs that were previously included on my playlist but if I try to add and sync the new songs they dont show up on my i

  • Unable to deploy Soa project on Weblogic Soa Managed server.

    Hi, I have made a SOA/BPEL process in Jdeveloper 11.1.1.3. As I deploy the process on Managed server. I get the following error : Error: No J2ee modules detected in EAR Archive. Deployment Aborted==(Oracle.jdeveloper.deploy.VetoableDeployException) a

  • Isssue with Login of console,em in obiee 11g

    Hi all, I have installed obiee 11g on linux succefully.I deployed sample applite and checked it and it is working fine. Aftrer some time , suddenly the hole like console,enterprise manager,analytics getting very slow,I mean the console,em web page ab

  • What version of hardware is inside my router?

    Hi, I have a WRT54GS router but I am unclear as to what version of of hardware is inside.  The label on the bottom clearly indicates that the model number is a WRT54GS but there is no version after that.  The serial number starts with CGN10D7xxxxx. 

  • Remote editing via Contribute

    I have Dreamweaver 5.5 but not Contribute. My client has Contribute but not Dreamweaver. He wants to be able to edit text on his website, which I maintain. We are in different offices. Do I need Contribute as well as him to make this work?