当前位置:网站首页>UML series articles (26) architecture modeling -- artifacts

UML series articles (26) architecture modeling -- artifacts

2022-06-09 06:47:00 CoderIsArt

  • products 、 Classes and hosts
  • Modeling executable programs and Libraries
  • Counter table 、 file 、 And document modeling
  • Model the source code

Products exist in the physical world of bits , Therefore, it is an important building block when modeling the physical aspects of the system . An artifact is a physical and replaceable part of a system . Artifacts can be used to represent classes such as 、 Interface 、 Physical packaging of logical elements such as collaboration .

1. introduction

The final work product of a construction company is a physical building that exists in the real world . To build a model to visualize 、 Detailing and documenting design decisions for building appearance , Such as the position of walls and doors and windows 、 Wiring of power supply and piping system and overall architectural style . When the building was actually built , These walls 、 door 、 Windows and other conceptual things can become real physical things .

These logical and physical views are necessary . If a temporary building is being built and the cost of demolition and reconstruction is very low ( For example, build a dog kennel ), Maybe you can build physical buildings without any logical modeling . contrary , If you are building a permanent building with high cost of renovation and failure , So it is practical to build logical model and physical model for risk management .

The same is true of developing a software intensive system . Visualization through logical modeling 、 Detail and document decisions about domain terms and the structure and behavior of their collaboration . Construct executable system through physical modeling . These logical things exist in the conceptual world , And physical things exist in the bit world of computers , in other words , They eventually reside on physical nodes , And can directly execute , Or participate in the executable system in some indirect way .

stay UML in , Model all these physical things as artifacts . Artifacts are physical things at the platform level .

In the field of software , Many operating systems and programming languages directly support the concept of artifacts . Object library 、 Executable program 、.NET Components and Enterprise JavaBeans They are all examples of products , Both can be used. UML Express them directly .

Not only can these kinds of things be modeled with artifacts , And it can be used to express other things involved in the execution system , As shown in the table 、 file 、 Documents and documents .

    UML It provides graphical representation for products , As shown in the figure , This canonical representation allows you to visualize an artifact without the details of the operating system or programming language . And using derivatives ---UML One of the extension mechanisms of , You can also customize this representation , To express a particular type of product .

2. Terms and concepts

    products (artifact) Is the physical part of the system that exists in the implementation platform layer . On the graph , Draw the product with key words 《artifact》 The rectangular .

2.1 name

    Each artifact must have a name that is different from the others . name (name) Is a string of words , Call the individual names simple names (simple name); The product name prefixed with the package name of the package where the product is located is called the restricted name (qulified name). Drawing an artifact usually shows only its name . As shown in the figure below ,

 

2.2 Products and classes

    Products and classes are categories . However , There are also some significant differences between artifacts and classes :

  • Class represents logical abstraction , Artifacts represent physical abstractions that exist in the bit world . in short , Artifacts can exist on nodes , Classes cannot .
  • Artifacts represent the physical packaging of bits on the implementation platform .
  • Classes can have properties and operations ; Artifacts can implement classes and methods , But they have no properties or operations of their own .

Differences and relationships between artifacts and classes , You can use the following figure to show ,

 

2.3 Types of products

There are three kinds of :

  • Deployment artifacts (deployment artifact)

Such products are necessary and sufficient to constitute an executable system . Such as DLL,EXE

  • Work products (work product artifact)

    The product of the development process , Such as source code file , Data files, etc .

  • Execute the product (execute artifact)

    Created as a result of the system being executed , Such as DLL Instantiated .NET object

2.4 Standard elements

UML There are standard derivatives for products :

  • Executable program (executable)
  • library (libraries)
  • file (file)
  • file (document)

3. Common modeling techniques

3.1 Modeling executable programs and Libraries

 

3.2 Counter table 、 File and document modeling

 

3.3 Modeling source code

 

4. Tips and tricks

    When in UML When modeling artifacts in , Remember to model on physical characteristics . A well structured product , The following requirements shall be met :

  • Directly implement a set of common work , With economy 、 Classes that effectively complete the semantics of these interfaces ;
  • It is loosely coupled with other products . 
原网站

版权声明
本文为[CoderIsArt]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/160/202206090625345162.html