Abstract Class and polymorphism - class diagram

Hi,
]Im trying to draw a class diagram for my overall system but im not too sure how to deal with classes derived from abstract classes. I'll explain my problem using the classic shape inheritance senario...
myClass has a member of type Shape, but when the program is running shape gets instantiated to a circle, square or triangle for example -
Shape s = new circle();
since they are shapes. But at no stage is the class Shape instantiated.
I then call things like s.Area();
On my class diagram should there be any lines going from myClass directly to circle or triangle, or should a line just be joining myClass to Shape class?
BTW - is s.Area() polymorphism?
Thanks,
Conor.

Sorry, my drawing did not display very well.
If you have MyClass, and it has a class variable of type Shape, and the class is responsible for creating MyClass, use Composition on your UML diagram to link Shape and MyClass.
If you have MyClass, and it has a class variable of type Shape, and the class is created elsewhere, use Aggregation on your UML diagram to link Shape and MyClass.
If you have MyClass, and it is used in method signatures, but it is not a class variable, use Depedency on your UML diagram to link Shape and MyClass. The arrow will point to Shape.
Shape and instances of Circle, Triangle, Square, etc. will be linked using a Generalization on your UML diagram. The arrow will always point to Shape.
Anything that is abstract (class, method, variable, etc.) should be italicized. Concrete items (same list) should be formatted normally.
BTW, the distinction between Composition, Aggregation and Dependency will vary from project to project or class to class. It's a gray area. Just be consistent or follow whatever guidelines have been established.
- Saish

Similar Messages

  • What is the relation between main class and inner classes

    hi
    i want to make a UML design and o want to know how to draw the relation betwwen the main public class and inner classes?
    and what is the relation?

    BaffyOfDaffyA wrote:
    Please keep in mind that if you spell better you will get better answers and if you add duke stars you will get better answers and if you mark the thread as a question you will get better answers. That will make it look like you are paying attention and that you really want an answer.
    My best answer based on your rather vague question:
    A minimal public class in a file named "Minimal.java" in the directory named "minimal":
    package minimal;
    public class Minimal {
    private int variable;
    public Minimal(int var) {
    variable = var;
    public int getVariable() {
    return variable;
    }This would be an example of adding an inner class:
    package minimal;
    public class Minimal {
    private int variable;
    public Minimal(int var) {
    variable = var;
    public int getVariable() {
    return variable;
    public class Inner {
    private int innerVariable;
    public Inner(int var) {
    innerVariable = var;
    public int getInnerVariable() {
    return innerVariable;
    }The inner class is exactly like any other inner class except if you are accessing it from anything else other than Minimal then you would have to add Minimal. right before Inner for example, where the Minimal class could use
    Inner inner = new Inner(5);other classes would have to use
    Minimal.Inner inner = new Minimal.Inner(5);
    See [Inner Class Example|http://java.sun.com/docs/books/tutorial/java/javaOO/innerclasses.html] or [Nested Classes|http://java.sun.com/docs/books/tutorial/java/javaOO/nested.html] for more information.
    He is probably not asking what an inner class is or how to declare one in raw source code. To me he is asking how do I
    explain this relationship in a UML diagram and as UML is not and exact science and expression can vary a lot
    between UML design applications I didn't want to stab in the dark.
    @OP I would say whatever seems most logical to you and your team, write something that reads.

  • What is the difference between document class and normal class

    Hi,
    Please let me know what is the difference between document class and normal class.
    And I have no idea which class should call as document class or call as an object.
    Thanks
    -Actionscript Developer

    the document class is invoked immediately when your swf opens.  the document class must subclass the sprite or movieclip class.
    all other classes are invoked explicitly with code and need not subclass any other class.

  • Data class and Delivery class in ABAP Dictionary

    Hi all,
    I want to know the exact information about Data class and Delivery class in ABAP Dictionary
    Moderator message : Search for available information. Thread locked.
    Edited by: Vinod Kumar on Aug 3, 2011 1:35 PM

    As your name Suggests, there were exactly 21 rajapandian already who wanted exact information about  Data class and Delivery class. Fortunately some has found the information by own and some were dumped by SAP Police.
    Cheers
    Amit

  • Tables for development class and Message Class

    Hi All,
    In which table is Message Class and Development class stored.
    Thanks,
    Santosh

    Hi All,
    I am closing this thread..I was looking for a single table which does this and it is TADIR with object = MSAG
    Thanks,
    Santosh
    Edited by: Santosh Kumar KezkhepatMelathil on Aug 29, 2008 1:32 PM

  • Data class and storage class

    Hi ,
    I need some info or docs on data class and stroge class of DSO /cube.
    Regards
    tapashi

    Hi Tapashi,
    Something i found about dataclass in DSO/Cube, which might be useful to you.
    Within SAP BW following data class of DDIC objects are important:
    DDIM           Dimension Tables in BW of InfoCubes
    DFACT          Facts Table in BW of InfoCubes
    DODS           ODS Tables in BW
    These have been introduced in order to improve performance while reading/writing InfoProviders. Settings of data class are maintained in "Technical Settings -> Database storage parameters" screen of TA SE11. Data class is assigned to the database tables of the InfoCube (table RSDCUBE, RSDODSO). Notice that this assignment cannot be made by any circumstances by user, only system does this while you activate InfoProvider.
    Subsequently see overview of table RSDCUBEu2019s fields with link to data class according BW versions:
    SAP BW 3.x (parameters only affect aggregates, not the cube):
    AGGRDATCLS     Data class for aggregate fact tables (only aggregates)
    AGGRSIZCAT     Size category for aggregate fact tables
    ADIMDATCLS     Data class for aggregate dimension tables
    ADIMSIZCAT     Size category for aggregate dimension tables
    Furthermore see overview of RSDODSOu2019s fields for DSO objects as InfoProvider with link to data class:
    ODSADATCLS     Data class for table with active data of the ODS
    ODSMDATCLS     Data class for table with ODS input data
    To see all available data classes check table: DDART (DD: Data Class in Technical Settings)
    To see all available size categories check table: DGKAT (DD: Size category in technical settings)
    Hope this is helpful.
    Regards
    Snehith

  • Processing classes , evaluation classes and cumulation classes

    Hi All ,
       Can anybody give the details of PCR in HR and how to use processing classes and evaluation classes in PCR.
    Regards ,
    Santosh.

    Hi,
    we have an operation VWTCL which checks the Processing class and its specification in PCR.
    go to T.Code: PE04 and check the operations documentation you will get clarity.
    Operation VWTCL VV reads the specification of processing class VV for the current wage type in table T512W, and enters this as a single-character entry in the variable argument of the personnel calculation rule. Function VWTCL is a decision operation.
    for example:
    X010 Determination of valuation bases INTERNATIONAL
            VWTCL 01   Processing class
                ERROR      Cancel processing
              0
                ADDWT *    OT   Output table
        1
            VWTCL 01   Processing class
              0
              1
                ADDWT *    OT   Output table
                ELIMI Z    Elim.time period ID
    Regards,
    mohammed

  • LinkedList class and ArrayList class

    Hi everyone,
    What is difference between LinkedList class and ArrayList class ??

    Hi samue!
    If you had typed that question you would have got many answers.anyway
    difference between Linked List and ArrayList
    1.In linked list each element is stored as an object but not in arraylist
    2.Linked list need iterator to go through its contents but not arraylist
    3.reading element from each takes same time but if you want to add or remove element from the arraylist it takes considerable amount of time depending on the index number. in Linkedlist case it takes constant amount of time to add/remove at any index.
    this should be enough guess to know the difference but if u need try goooogle

  • What are exception class and persistant class?

    hi,
    what are exception class and persistant class?
    how are they different from the normal class?
    Regards,
    Anil

    Hii!
      Persistent Classes
    To use the Persistence Service for objects, the classes of these objects must be created as persistent classes in the Class Builder. The term persistent class does not imply that a class is persistent. (As a template for objects, every class is persistent). Rather, it means that the objects of that class and their state are managed by the Persistence Service. For example, the objects of these classes are instantiated in the ABAP program with a method of the Persistence Service, which ensures that the initialization is correct (not with the usual CREATE OBJECT statement). When the Class Builder creates a persistent class, it automatically generates an associated class, known as the class actor or class agent, whose methods manage the objects of persistent classes. As well as their identity, persistent classes can contain key attributes, which allow the Persistence Service to ensure that the content of each persistent object is unique.
      Check out this link
    http://www.sapnet.ru/abap_docu/ABENABAP_EXCEPTION_CLASSES.htm
    Regards
    Abhijeet

  • Difference between Data Class and Delivery Class

    What is the Difference between Data Class and Delivery Class , what happens Phisically to the Data .
    Moderator message: what is the difference between your question and a question that we'd welcome here in the forums?
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Thomas Zloch on Nov 22, 2010 1:17 PM

    What is the Difference between Data Class and Delivery Class , what happens Phisically to the Data .
    Moderator message: what is the difference between your question and a question that we'd welcome here in the forums?
    [Rules of engagement|http://wiki.sdn.sap.com/wiki/display/HOME/RulesofEngagement]
    Edited by: Thomas Zloch on Nov 22, 2010 1:17 PM

  • Singleton pattern class and static class

    Hi,
    what is difference between the singleton pattern class and static class ?
    in singleton pattern, we declare a static member[which hold one value at a time] ,static method[ which return static member value] and a private constructor[not allow to direct instantiation]. My words are -- as a singleton pattern we implement static class .
    so can we say a singleton pattern is static class it means both are same or is any difference between these two ??

    malcolmmc wrote:
    On several occasions I've had to convert a static (never instanceated) class to a singleton type, for example because I realise I need an instance per thread, or I decide to make a program more modular, with more than one configuration.
    I've never done the opposite.
    So generally I favour the singleton if there any "state" involved, because it's more flexible in unanticipated directions. It also gives extra flexibility when building tests, especially if you program to an interface.Total agreement; if anything it is dead hard to override static method logic with mock code in unit tests (I had to do it by keeping the static methods in place but making them internally use a singleton instance of itself of which the instance variable could be overwritten with a mock implementation for unit testing purposes...).
    'Static classes' and/or methods are great for very simple util functions, but I wouldn't use them for anything other than that.

  • Difference between Material Class and Batch Class

    Hi!
    What is the difference between Material Class and Batch Class?
    and how can we use these classes?
    Rgds,
    Ajit

    Iam not sure but i think
    1) Material class for sorting purpose
    2) Batch Class for Batch Management
    thanks
    K.Prabakaran

  • Owner Class and Base Class ?

    hi,
    What is an Owner class and base class?
    thanks,
    Hanu

    Hi,
    the question is related to oracle java class or samething else?
    I dont understand your question.
    Regards,
    Tom

  • Evaluation classes and cumulation classes

    Hi All ,
       Can anybody give the information about evaluation classes and cumulation classes in HR and how they affects the payroll.It is better for me if any one give the scenario to understand these concepts.I know the basics of these things i.e in which view these details are maintained for wagtypes.
    Thanks in advance.
    Regards ,
    Santosh.

    Hi Santosh,
    For any wagetype to process in payroll these cummulation class and evlatuion class is important.As payroll is Country specific each county has specific base for calculating Cummulation class.
    Cummulation Class: In payroll there are two types of cummulation
    (a) Cummulation of wage types over another wage type
    (b) Cummulation of wage types over a period of time
    For the first one it is used to calculate the base for different tax calculation. It is represented by /1 series wage types. Examples  For HRA Basis it is /111  and the base is mainly Basic+DA...etc.
    For the second one it is calculated by Processing class 30 Specification 0,1,2,3 and T. The related tables are V-T54c1, V_T54c4 and V_T54c3
    Evaluation Class: This  is used mainly for reports i,e Form 16, Form 24, Payslips etc. In India mostly used Evaluation classes are
    02 - For Payments and Deductions in Payslip
    06 - For Sec 17(1) For Total Gross
    07 - For Sec 10 Deductions
    09 - For Sec 17(3) For Perks
    08 - For Sec 17(2) For Income from other sources
    11 - For Sec 217 2 (A)
    * All these reports you can see in table V-T512w_D or V_t512w_O
    I think this will help you
    Best Regards
    Baidya

  • Processing classes, cumulation classes and evaluation classes

    Hi Friends,
             What is the diff between  processing classes, cumulation classes and evaluation classes. where we see these three and what is the table no. for this?

    .) Processing Class - A wage type characteristic that controls processing during Payroll. There are different processing classes for the various processing steps that are performed within Payroll. During the payroll run, SAP R/3 processes a wage type in a specific processing step according to its individual specification in the respective processing class.
    Cumulation class - Cumulation class are used to cumulate the model wage types to generate the /1** technical wage types.
    Example - Processing class 20 is used for cumulation and processed by PCR X023. Now suppose you have set specifiction as 8. Now if you will check PCR X023 for spec 8, it says to cumulate wage type into cumulation class which are ticked. Like may be you want to cumulate a model wage type into /101, set PCL 20 as 8 and tick cumulation class 1.
    Evaluation Class - Wage type characteristic that controls processing when payroll results are evaluated and displayed. There are various evaluation classes for the different processing steps that are performed when payroll results are evaluated and displayed.
    Example
    In the standard system, the specifications for evaluation class 02 determine how a wage type is printed on a form  that is payslip.
    Specification 00: no printing on the form
    Specification 01: prints personal payments/deductions
    Specification 02: prints wage types included in the total gross amount
    Specification 03: prints wage types derived from time-based payments and included in the total gross amount

Maybe you are looking for

  • Spry Submenus Not Visible on RHS only

    My spry submenus work totally fine except for the very far right hand side of the page where the submenus are cut off. I can see the very beginning of the submenu but the rest of it with the text is hidden once it goes past the edge of the page. Clic

  • Performance on connection pooling

    Hi there, Does solution for CR099363 found in link http://e-docs.bea.com/wls/docs70/notes/resolved.html#1295792 work for WL6.1 platform by setting parameter secondsToTrustAnIdlePoolConnection to a positive integer? Or does this only work on WL7.0 pla

  • HT2534 How do I purchase an iTunes voucher delivered by email using my iPad ?

    How do I purchase an iTunes voucher delivered by email on my iPad. Tried iTunes apple store and apple via safari

  • Reading old PDD files

    I'm trying to help an elderly friend. She has some pdd files from the days when Photoshop would only allow work files to be saved in .pdd format. Can anyone give me any guidance as to what modern software may be able to read them, or is there anythin

  • Where the policy object stored in the LDAP

    Hi Do anyone knows where do SAM saves the policy objects in the LDAP? thanks