در ادامه، برای هر نوع نمودار که تا حالا ساختیم، یک بلوک کامل در PlantUML میدهم.
میتوانی هر کدام را جداگانه در هر ابزار PlantUML اجرا کنی.
۱) Class Diagram – ساختار کلاسها
@startuml ClassDiagram class Person { +name: String } class DaughterFunction { +apply(x: Person): Person } class MotherFunction { +apply(x: Person): Person } class BrothersSet { +of(x: Person): Set } class RelativesSet { +of(x: Person): Set } class SelfGovernance { +isSelfGoverned(x: Person): Boolean } Person "1" --> "1" DaughterFunction : input DaughterFunction --> Person : returns Person "1" --> "1" MotherFunction : input MotherFunction --> Person : returns Person "1" --> "1" BrothersSet : input BrothersSet --> "0..*" Person : member Person "1" --> "1" RelativesSet : input RelativesSet --> "0..*" Person : member SelfGovernance --> Person : appliesTo @enduml
۲) Object Diagram – نمونهٔ جرّاره و زنجیرهاش
@startuml ObjectDiagram object JARRARE as "JARRARE : Person" { name = "جرّاره" } object D1 as "D1 : Person" { name = "دخترِ جرّاره" } object D2 as "D2 : Person" { name = "دخترِ دخترِ جرّاره" } object M1 as "M1 : Person" { name = "مادرِ دخترِ دخترِ جرّاره" } object BrothersOfD2 as "BrothersOfD2 : Set" { members = {برادر۱, برادر۲, ...} } object RelativesOfD2 as "RelativesOfD2 : Set" { members = {عمو, خاله, پسرعمو, دوست خانوادگی, ...} } JARRARE --> D1 : apply(DaughterFunction) D1 --> D2 : apply(DaughterFunction) D2 --> M1 : apply(MotherFunction) D2 --> BrothersOfD2 : of(BrothersSet) D2 --> RelativesOfD2 : of(RelativesSet) @enduml
۳) Package Diagram – بستههای معنایی
@startuml PackageDiagram package "Individuals" { class Person } package "KinshipFunctions" { class DaughterFunction class MotherFunction } package "KinshipSets" { class BrothersSet class RelativesSet } package "DescriptiveAttributes" { class SelfGovernance } KinshipFunctions ..> Individuals KinshipSets ..> Individuals DescriptiveAttributes ..> Individuals @enduml
۴) Sequence Diagram – اجرای توابع روی جرّاره
@startuml SequenceDiagram actor User participant "JARRARE : Person" as J participant "D1 : Person" as D1 participant "D2 : Person" as D2 participant "M1 : Person" as M1 participant DaughterFunction as DF participant MotherFunction as MF participant BrothersSet as BS participant RelativesSet as RS participant "BrothersOfD2 : Set" as BSet participant "RelativesOfD2 : Set" as RSet User -> J : provide input (JARRARE) J -> DF : apply(JARRARE) DF --> D1 : D1 D1 -> DF : apply(D1) DF --> D2 : D2 D2 -> MF : apply(D2) MF --> M1 : M1 D2 -> BS : of(D2) BS --> BSet : BrothersOfD2 D2 -> RS : of(D2) RS --> RSet : RelativesOfD2 @enduml
۵) Activity Diagram – جریان کاری ساخت S5
@startuml ActivityDiagram start :Input Person = JARRARE; :Apply DaughterFunction; :Output = D1; :Apply DaughterFunction; :Output = D2; :Apply MotherFunction; :Output = M1; :Build BrothersSet(D2); :Output = BrothersOfD2; :Build RelativesSet(D2); :Output = RelativesOfD2; :Combine Results; note right S5 = {M1} ∪ BrothersOfD2 ∪ RelativesOfD2 end note stop @enduml
۶) Use-Case Diagram – قابلیتهای سیستم خویشاوندی
@startuml UseCaseDiagram actor User usecase "Generate Daughter Chain" as U1 usecase "Generate Mother Chain" as U2 usecase "Build Brothers Set" as U3 usecase "Build Relatives Set" as U4 usecase "Combine Kinship Structure (S5)" as U5 User --> U1 User --> U2 User --> U3 User --> U4 User --> U5 @enduml
۷) Component Diagram – معماری اجزای سیستم
@startuml ComponentDiagram component "Individuals Component" as IC { } component "Kinship Functions Component" as KFC { interface IF_KF { + applyDaughter(x: Person): Person + applyMother(x: Person): Person } } component "Kinship Sets Component" as KSC { interface IF_KS { + getBrothers(x: Person): Set + getRelatives(x: Person): Set } } component "Attributes Component" as AC { interface IF_ATTR { + isSelfGoverned(x: Person): Boolean } } KFC ..> IC KSC ..> IC AC ..> IC @enduml
۸) Deployment Diagram – استقرار روی نودها
@startuml DeploymentDiagram node "Client Node" { component "User Interface" component "UML Viewer" } node "Application Server Node" { component "Kinship Functions Component" component "Kinship Sets Component" component "Attributes Component" } node "Knowledge Base Node" { database "Individuals Repository" database "Relations Storage" database "Attribute Storage" } "Client Node" --> "Application Server Node" : HTTP / API "Application Server Node" --> "Knowledge Base Node" : DB / Knowledge Access @enduml
۹) State Machine Diagram – حالتهای سیستم در مسیر ساخت S5
@startuml StateMachineDiagram [*] --> BasePerson state BasePerson { note right: x = JARRARE } BasePerson --> FirstDaughter : applyDaughter state FirstDaughter { note right: x = D1 } FirstDaughter --> SecondDaughter : applyDaughter state SecondDaughter { note right: x = D2 } SecondDaughter --> MotherOfD2 : applyMother state MotherOfD2 { note right: x = M1 } MotherOfD2 --> BrothersBuilt : buildBrothersSet state BrothersBuilt { note right: BrothersOfD2 created } BrothersBuilt --> RelativesBuilt : buildRelativesSet state RelativesBuilt { note right: RelativesOfD2 created } RelativesBuilt --> Final : combineAll state Final { note right: S5 = M1 ∪ Brothers ∪ Relatives } Final --> [*] @enduml
۱۰) Communication Diagram – شبکهٔ پیامها بین اشیاء
@startuml CommunicationDiagram object JARRARE object D1 object D2 object M1 object BrothersOfD2 object RelativesOfD2 object DaughterFunction object MotherFunction object BrothersSet object RelativesSet JARRARE -[#0000FF]-> DaughterFunction : 1: apply(JARRARE) DaughterFunction -[#0000FF]-> D1 : 1.1: return D1 D1 -[#0000FF]-> DaughterFunction : 2: apply(D1) DaughterFunction -[#0000FF]-> D2 : 2.1: return D2 D2 -[#0000FF]-> MotherFunction : 3: apply(D2) MotherFunction -[#0000FF]-> M1 : 3.1: return M1 D2 -[#0000FF]-> BrothersSet : 4: of(D2) BrothersSet -[#0000FF]-> BrothersOfD2 : 4.1: return BrothersOfD2 D2 -[#0000FF]-> RelativesSet : 5: of(D2) RelativesSet -[#0000FF]-> RelativesOfD2 : 5.1: return RelativesOfD2 @enduml
۱۱) Composite Structure Diagram – ساختار درونی سیستم
@startuml CompositeStructureDiagram class KinshipProcessingSystem { } class PersonProcessor { +inPerson: Person +outPerson: Person } class DaughterModule { +in: Person +out: Person } class MotherModule { +in: Person +out: Person } class BrothersSetModule { +in: Person +out: Set } class RelativesSetModule { +in: Person +out: Set } KinshipProcessingSystem o-- PersonProcessor KinshipProcessingSystem o-- DaughterModule KinshipProcessingSystem o-- MotherModule KinshipProcessingSystem o-- BrothersSetModule KinshipProcessingSystem o-- RelativesSetModule PersonProcessor "outPerson" --> "in" DaughterModule DaughterModule "out" --> "in" DaughterModule : recursion DaughterModule "out" --> "in" MotherModule MotherModule "out" --> "in" BrothersSetModule MotherModule "out" --> "in" RelativesSetModule @enduml
۱۲) Interaction Overview Diagram – نقشهٔ کلی تعاملها
@startuml InteractionOverviewDiagram start :Input Person (JARRARE); partition "Daughter Chain" { :Sequence: JARRARE → D1 → D2; } partition "Mother Step" { :Sequence: D2 → M1; } partition "Build Sets" { :Activity: BrothersSet.of(D2); :Activity: RelativesSet.of(D2); } partition "Combine Results" { :Sequence: S5 = M1 ∪ BrothersOfD2 ∪ RelativesOfD2; } stop @enduml
اگر بخواهی، میتوانیم یکییکی اینها را اصلاح/گسترش کنیم؛ مثلاً:
- فارسیسازی نام کلاسها و use caseها
- اضافه کردن constraints منطقی (OCL)
- یا ساختن یک فایل واحد که همهٔ این نمودارها را در خود داشته باشد.
دوست داری قدم بعدی چی باشد: اصلاح دقیق همین مدل، یا بردنش به سمت یک مقاله/سیستم واقعی؟
در این وبلاگ به ریاضیات و کاربردهای آن و تحقیقات در آنها پرداخته می شود. مطالب در این وبلاگ ترجمه سطحی و اولیه است و کامل نیست.در صورتی سوال یا نظری در زمینه ریاضیات دارید مطرح نمایید .در صورت امکان به آن می پردازم. من دوست دارم برای یافتن پاسخ به سوالات و حل پروژه های علمی با دیگران همکاری نمایم.در صورتی که شما هم بامن هم عقیده هستید با من تماس بگیرید.