UML - Class Diagram - Tutorialspoint
文章推薦指數: 80 %
Class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the ... Home CodingGround Jobs Whiteboard Tools Business Teachwithus UMLTutorial UML-Home UML-Overview UML-BuildingBlocks UML-Architecture UML-ModelingTypes UML-BasicNotations UML-StandardDiagrams UML-ClassDiagram UML-ObjectDiagram UML-ComponentDiagram UML-DeploymentDiagram UML-UseCaseDiagram UML-InteractionDiagram UML-StatechartDiagram UML-ActivityDiagram UML-Summary UML2.0Overview UML2.0-Overview UMLUsefulResources UML-UsefulResources UML-KnowledgeTest Utilities UML-Tools&Utilities UML-Discussion SelectedReading UPSCIASExamsNotes Developer'sBestPractices QuestionsandAnswers EffectiveResumeWriting HRInterviewQuestions ComputerGlossary WhoisWho UML-ClassDiagram Advertisements PreviousPage NextPage UMLOnlineTraining 77Lectures 6.5hours ArnabChakraborty MoreDetail UMLClassDiagrams 37Lectures 2hours FelixTuna MoreDetail Object-OrientedAnalysis,DesignandProgrammingwithUML 122Lectures 10hours PacktPublishing MoreDetail Classdiagramisastaticdiagram.Itrepresentsthestaticviewofanapplication.Classdiagramisnotonlyusedforvisualizing,describing,anddocumentingdifferentaspectsofasystembutalsoforconstructingexecutablecodeofthesoftwareapplication. Classdiagramdescribestheattributesandoperationsofaclassandalsotheconstraints imposedonthesystem.TheclassdiagramsarewidelyusedinthemodelingofobjectorientedsystemsbecausetheyaretheonlyUMLdiagrams,whichcanbemappeddirectlywithobject-orientedlanguages. Classdiagramshowsacollectionofclasses,interfaces,associations,collaborations,and constraints.Itisalsoknownasastructuraldiagram. PurposeofClassDiagrams Thepurposeofclassdiagramistomodelthestaticviewofanapplication.Classdiagramsaretheonlydiagramswhichcanbedirectlymappedwithobject-orientedlanguagesandthuswidelyusedatthetimeofconstruction. UMLdiagramslikeactivitydiagram,sequencediagramcanonlygivethesequenceflowoftheapplication,howeverclassdiagramisabitdifferent.ItisthemostpopularUMLdiagraminthecodercommunity. Thepurposeoftheclassdiagramcanbesummarizedas− Analysisanddesignofthestaticviewofanapplication. Describeresponsibilitiesofasystem. Baseforcomponentanddeploymentdiagrams. Forwardandreverseengineering. HowtoDrawaClassDiagram? ClassdiagramsarethemostpopularUMLdiagramsusedforconstructionofsoftware applications.Itisveryimportanttolearnthedrawingprocedureofclassdiagram. Classdiagramshavealotofpropertiestoconsiderwhiledrawingbutherethediagramwillbeconsideredfromatoplevelview. Classdiagramisbasicallyagraphicalrepresentationofthestaticviewofthesystemandrepresentsdifferentaspectsoftheapplication.Acollectionofclassdiagramsrepresentthewholesystem. Thefollowingpointsshouldberememberedwhiledrawingaclassdiagram− Thenameoftheclassdiagramshouldbemeaningfultodescribetheaspectofthesystem. Eachelementandtheirrelationshipsshouldbeidentifiedinadvance. Responsibility(attributesandmethods)ofeachclassshouldbeclearlyidentified Foreachclass,minimumnumberofpropertiesshouldbespecified,asunnecessarypropertieswillmakethediagramcomplicated. Usenoteswheneverrequiredtodescribesomeaspectofthediagram.Attheendofthedrawingitshouldbeunderstandabletothedeveloper/coder. Finally,beforemakingthefinalversion,thediagramshouldbedrawnonplainpaperandreworkedasmanytimesaspossibletomakeitcorrect. ThefollowingdiagramisanexampleofanOrderSystemofanapplication.Itdescribesaparticularaspectoftheentireapplication. Firstofall,OrderandCustomerareidentifiedasthetwoelementsofthesystem.Theyhaveaone-to-manyrelationshipbecauseacustomercanhavemultipleorders. Orderclassisanabstractclassandithastwoconcreteclasses(inheritancerelationship)SpecialOrderandNormalOrder. ThetwoinheritedclasseshaveallthepropertiesastheOrderclass.Inaddition, theyhaveadditionalfunctionslikedispatch()andreceive(). Thefollowingclassdiagramhasbeendrawnconsideringallthepointsmentionedabove. WheretoUseClassDiagrams? Classdiagramisastaticdiagramanditisusedtomodelthestaticviewofasystem.Thestaticviewdescribesthevocabularyofthesystem. Classdiagramisalsoconsideredasthefoundationforcomponentanddeploymentdiagrams.Classdiagramsarenotonlyusedtovisualizethestaticviewofthesystembuttheyarealsousedtoconstructtheexecutablecodeforforwardandreverseengineering ofanysystem. Generally,UMLdiagramsarenotdirectlymappedwithanyobject-orientedprogramminglanguagesbuttheclassdiagramisanexception. Classdiagramclearlyshowsthemappingwithobject-orientedlanguagessuchasJava,C++,etc.Frompracticalexperience,classdiagramisgenerallyusedforconstructionpurpose. Inanutshellitcanbesaid,classdiagramsareusedfor− Describingthestaticviewofthesystem. Showingthecollaborationamongtheelementsofthestaticview. Describingthefunctionalitiesperformedbythesystem. Constructionofsoftwareapplicationsusingobjectorientedlanguages. PreviousPage PrintPage NextPage Advertisements
延伸文章資訊
- 1【UML】Class Diagram 類別圖(上):Introduction 簡介
- 2UML Class Diagram Tutorial - Lucidchart
Class diagrams are one of the most useful types of diagrams in UML as they clearly map out the st...
- 3Day7. UML類別圖說明 - iT 邦幫忙
Class diagram describes the structure of a system by showing the system's classes, their attribut...
- 4UML - Class Diagram - Tutorialspoint
Class diagram describes the attributes and operations of a class and also the constraints imposed...
- 5UML Class Diagram Tutorial - Visual Paradigm
The UML Class diagram is a graphical notation used to construct and visualize object oriented sys...