Systems Analysis II Package and Deployment Diagrams

W
Document Sample
scope of work template
							       Systems Analysis II
       Package and Deployment Diagrams
           INFO 355
           Glenn Booker



INFO 355                  Week #6        1
           Packages

              Classes are the most basic logical
               element in an OO system
              We need a way to group related
               classes into larger structures
              A Package can contain classes,
               other packages, or a combination
               of the two



INFO 355                    Week #6                 2
           Packages

              Packages can therefore have a large
               scope (e.g. entire subsystems)
              In writing, a double colon separates
               a package name from its contents
                  Package::otherpackage::classname
                           Package

                             otherpackage

                                     classname




INFO 355                         Week #6              3
           Package Diagram

              The Package Diagram can be very
               helpful in understanding the
               architecture of a system
                  What are the big pieces of this system?
              Defining connections among
               packages also helps encourage
               higher modularity for each package



INFO 355                       Week #6                   4
           Packages

              In a diagram, a package may be
               just a tabbed folder
                                                      Staff




              Or a package can list its contents
               (classes and/or packages)
                                              Staff

                                                Employee
                (this was done                  Manager
               manually in Visio)                Person
                                                  SSN

INFO 355                            Week #6                   5
           Packages

              The smallest packages can be
               drawn large enough to include
               the class diagram they contain
                      Staff


                                   Person



                                                      SSN




                        Employee            Manager

 (also done
 manually)


INFO 355                              Week #6               6
           Packages

              If showing a class diagram within a
               package, can show connection to
               other packages by using the fully
               qualified name of the class in
               another package
                  See also the <<system>> stereotype
                      Shipping::Shipment     Person




INFO 355                           Week #6              7
           Package Diagram

              Packages can contain both packages
               and classes
              Dashed lines show direction of
               dependency Shipping
                                                   Container

                                 Dock




                                        Shipment




INFO 355                   Week #6                             8
           Package Dependencies
              For additional refinement,
               dependencies can be labeled with
               various stereotypes, such as
                  Call
                  Instance
                  Copy
                  Derived
                  Send
                  Import


INFO 355                      Week #6             9
           Package Generalization

              Generalization can be shown with
               packages, not just classes
                  Might be used in implementation to
                   distinguish among different kinds of
                   similar interfaces, for example




INFO 355                       Week #6                    10
           Packages

              It is possible to have classes
               with identical names in
               different packages
                  Customer::Person
                  Client::Person
              You might want this to reuse
               non-primitive data type classes



INFO 355                      Week #6            11
           Package Stereotypes

              Packages can specify stereotypes
               to indicate their purpose
                  <<façade>> to indicate the façade
                   pattern is being implemented with
                   this package
                  <<system>> to indicate the package
                   represents an external system

                          «facade»           «system»
                         HR Interface       HR System



INFO 355                          Week #6               12
           Package Stereotypes
                <<stub>> could represent a package
                 which isn’t going to be implemented
                 yet, but is a placeholder
                <<framework>> represents a
                 commercial development framework



                         «stub»
                                             «framework»
                     Third Iteration
                                             Visual Studio
                       Features




INFO 355                           Week #6                   13
           Package Visibility

              Packages can have the same
               visibility characteristics as any
               class, method, or attribute
                  Public
                  Private
                  Protected
              This doesn’t show on its symbol



INFO 355                       Week #6             14
           Deployment Concept

              Keep the typical 3-tier architecture
               in mind, when trying to define the
               contents of packages
              The physical tiered structure of
                  Web server / app server / data server
              Corresponds nicely to the MVC
               design pattern
                  M(data) V(web) C(app)


INFO 355                       Week #6                     15
           Deployment Concept

              Your system might be simpler, or
               more complex than 3-tier
              Large systems may have specialized
               servers for each type of application
                  Data mining servers
                  Intranet servers
                  Security servers
                  File servers, etc.


INFO 355                      Week #6             16
           Deployment Concept

              So your system’s approach for
               collecting classes into packages,
               and where those packages
               become executable code, should
               be consistent
                  Can define the scope of packages so
                   they will each be implemented on a
                   single type of server, e.g. may group
                   classes into packages by MVC type


INFO 355                       Week #6                     17
           Deployment Diagram

              The deployment diagram is the
               only UML diagram specifically for
               the PHYSICAL implementation of
               a system
              The deployment diagram shows
               nodes connected by communication
               paths                   Node2
                      Node1
                                    communication path




INFO 355                      Week #6                    18
           Nodes

              A node is some physical
               environment which can run software
                  A device is a piece of hardware which
                   runs software
                  An execution environment is software
                   which hosts other software, such as an
                   operating system
              Nodes contain the artifact files
               (exe, dll, jar, scripts, data, HTML)

INFO 355                       Week #6                  19
           Nodes

              Nodes can simply list the artifacts
               within them, or show a simple
               diagram to indicate the connections
               between artifacts
              Additional properties can be added
               in brackets {}, though this isn’t part
               of the UML standard
                  {vendor=aa}, {OS=bb}, {server=cc}


INFO 355                     Week #6                   20
           Nodes

              Visio allows editing the name, and
               adding comments to a node
                  Can resize the node, and superimpose
                   the artifact names manually

                   Extended name
                                   {
                                             Web Server

                     for a node              {OS=Win Server 2003}
                                             {web server=Apache}


                                              Myweb.war




INFO 355                           Week #6                          21
           Communication Paths
              The communication path between
               nodes is a plain line with a label
                  The label shows the protocol or type of
                   messages sent over the path, a front
                   slash ‘/’, then the type of network
                   connection
                       http/Internet, MILSTRIP/LAN
              Paths within a node don’t need to
               show the type of connection
                  Just the protocol: JDBC, ODBC

INFO 355                          Week #6                22

						
Related docs