UML Basic Concept--class diagram relation Dependency, association, generalization, implementation

Source: Internet
Author: User
Tags constructor inheritance stub
First, the concept:

Introduction to the basic concepts of UML:

UML:UML (Unified Modeling Language) provides a unified, standard, and visual modeling language for object-oriented software design. It is suitable for describing the whole process of software design which is driven by use case and is architecture-centric.

StarUML Use tutorial See http://blog.csdn.net/monkey_d_meng/article/details/5995610/


UML Model Diagram is composed of things, relationships and graphs.
1, things: things are: component things "class, interface, use cases, components, nodes and other" behavior things "interaction, state machine" group things "package" annotation Things "comment"
2. Relationship: Dependency, association "aggregation, Combination", generalization, implementation
3, Diagram: class diagram, use case diagram, state diagram, object graph, sequence diagram, collaboration diagram, activity diagram, Component diagram, deployment diagram and so on.
Second, the UML syntax description: "This picture is truncated in startuml detailed tutorial"

third, the relationship of class diagram in UML: 1, generalization (generalization):is a class (called a subclass, sub-interface) that inherits the functionality of another class (called a parent, parent interface) and can augment its own new functionality, which is the most common relationship between classes and classes or interfaces and interfaces, and in Java such relationships are explicitly identified by the keyword extends.

Represented by an implementation with a hollow arrow. "Other relationship representations, see UML syntax descriptors"
The class diagram is described as follows:
The inheritance code for the class is as follows:[Java]View plain copy package dim.uml.generalization;       /* * ClassA extends ClassB, ClassA is_a ClassB * * public class ClassA extends classb{public ClassA () { Todo auto-generated constructor stub}} class ClassB {public ClassB () {//Todo Auto The inheritance code for the-generated constructor stub}} interface is as follows: interface A:[Java]View plain copy package dim.uml.generalization;   public interface Interfacea {void Dosometingina (); Interface B: Inherit interface A[Java]View plain copy package dim.uml.generalization;   Public interface Interfaceb extends interfacea{void Dosometinginb (); Test interface: You can see that the interface B is inherited, and the Dosomethingina and DOSOMETHINGINB are replicated.[Java]  View plain  copy package dim.uml.generalization;      public class  testinterface  implements interfaceb{           @Override        public void dosometingina ()  {            // TODO Auto-generated method stub                   }     

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.