Week 8 Lecture Notes: System Modeling PDF
Document Details
Uploaded by IndividualizedJade9119
UWI, Mona
Tags
Summary
This lecture covers system modeling, describing the process of developing abstract models of a system. It discusses different views, perspectives, and notations like Unified Modeling Language (UML). The notes also cover model-driven engineering and its pros and cons.
Full Transcript
Week 8 Created @October 30, 2024 1:20 PM Type Lecture Reviewed 8.0 System Modeling MDE System Modeling System modelling is the process of developing abstract models of a system, with each model presenting a diffe...
Week 8 Created @October 30, 2024 1:20 PM Type Lecture Reviewed 8.0 System Modeling MDE System Modeling System modelling is the process of developing abstract models of a system, with each model presenting a different view or perspective of that system. Representing a system in some kind of graphical notation, which is now almost always based on notations in the Unified Modelling Language (UML) System modelling helps the analyst to understand the functionality of th system and models are used to communicate with customers. System Perspectives External Perspective: where you model the context or environment of the system. Internal Perspective: where you model the interactions between a system and it’s environment, or between the components of a system. Structural Perspective: where you model the organization of a system or the structure of the data that is processed by the system. Behavioural Perspective: Where you model the dynamic behaviour of the system and how it responds to events. Week 8 1 Uses of Graphical Models A means of facilitating discussion about an existing or proposed system. Incomplete and incorrect models are OK as their role is to support discussion. As a way of documenting an existing system. Models should be an accurate representation of the system but need not be complete. As a detailed system description that can be used to generate a system implementation. Models have to be both correct and complete. UML Diagram Types Activity Diagrams: show the activities involved in a process or in data processing. Use Case Diagrams: show the interactions between a system and its environment. Sequence Diagrams: show interactions between actors and the system and between system components. Class Diagrams: show the object classes in the system and the associations between these classes. State Diagrams: show how the system reacts to internal and external events. Model-driven Engineering Developing software from models rather than programs. The programs that execute on a hardware/software platform are then generated automatically from the models. It is argued that this raises the level of abstraction in software engineering, so that engineers no longer have to be concerned with programming language details, or the specifics of execution programs. Week 8 2 Pros and Conns of Model-driven Engineering Model-driven engineering is still at an early stage of development, and it is unclear whether or not it will have a significant effect on software engineering practice. Pros Allows systems to be considered at higher levels of abstraction. Generating code automatically means that it is cheaper to adapt systems to new platforms. Cons Models for abstraction and not necessarily right for implementation. Savings from generating code may be outweighed by the costs of developing translators for new platforms. Model Driven Architechture The precursor of more general model driven engineering. MDA is a model-focused approach to software design and imprementation that uses a subst of UML models to describe a system. Models at different levels of abstraction are created. From a high-level, platform independent model, it is possible , in principle, to generate a working program without manual intervention. Types of Model Computation Indepentent Model (CIM) These model the important domain abstractions used in a system. Somtimes called Domain Models Platform Independent Model (PIM) These model the operation of the system without reference to its implementation. Week 8 3 The PIM is usually described using UML models that show the static system structure and how it responds to external and internal events. Platform Specific Models (PSM) These are transformations of the platform-independent model with a separate PSM for each application platform. In principle, there may be layers of PSM, with each layer adding some platform-specific detail. You can have different layers for each model in terms of the platform that it’s going to be applied to. Adoption of MDA MDA not very consistent with agile methods as it reuires modeling and planning. It is not vary compatible with agile methods. A range of factors has limited the adoption of MDE/MDA: Specialized tool support is required to convert models from one level to another. There is limited tool availability and organizations may require tool adaptation and customisation to their environment. Week 8 4 For the long-lifetime systems developed using MDA, companies are reluctant to develop their own tools or rely on small companies that may go out of business. 8.1 Context & Interaction Models Context Models Context models are used to illustrate the operational context of a system - they show what lies outside the system boundaries. The other systems in the environment not how the system is being developed or used. Social and organisational concerns may affect the decision on where to position system boundaries. Architectural models show the system and its relationship with other systems. Process Perspective Context models simply show the other systems in the environmnet, not how the system being developed is used in that environment. Process models on the other hand reveal how the system being developed is used in a broader business process. UML activity diagrams may be used to define business process models. Example of a process model: Week 8 5 Interaction Models Modeling user interaction is important as it helps to identify user requirements. Modeling system-to-system interaction highlights the communication problems that may arise. Modeling component interaction help us to understand if a proposed system structure is likely to deliver the required system performance and dependability. Use case and sequence diagrams may be used for interaction modeling. Use Case Modeling Use cases were developed originally to support requirements elicitation and now incorporated into the UML. Each use case represents a discrete task that involves external interaction with a system. Actors in a use case may be people or other systems. Represented diagramatically to provide an overview of the use case and in a more detailed textual form. In the use case description. Sequence Diagrams Week 8 6 Sequence diagrams are part of the UML and are used to model the interactions between the actors and the objects within a system. A sequence diagram shows the sequence of interactions that take place during a particular use case or use case instance. The objects and actors involved are listed along the top of the diagram, with a dotted line drawn vertically from these. Interactions between objects are indicated by annotated arrows. Example of a sequence diagram: 8.2 Structural Behavioural Models Structural Models Structural models of software display the organization of a system in terms of the components that make up that system and their relationships. Structural models may be: Week 8 7 Static models, which show the structure of the system design Dynamic models, which show the organization of the system when it is executing. You create structural models of a system when you are discussing and designing the system architecture. Class Diagrams Class diagrams are used when developing an object-oriented system model to show the classes in a system and the associations between these classes. An object class can be thought of as a general definition of one kind of system object. An association is a link between classes that indicates that there is some relationship between these classes. When you are developing models during the early stages of the software engineering process, objects represent something in the real world, such as a patient, a prescription, doctor, etc. Behaviour Models Week 8 8 Behavioral models are models of the dynamic behavior of a system as it is executing. They show what happens or what is supposed to happen when a system responds to a stimulus from its environment. You can think of these stimuli as being of two types: Data Some data arrives that has to be processed by the system. Events Some event happens that triggers system processing. Events may have associated data, although this is not always the case. Data-driven Modeling Many business systems are data-processing systems that are primarily driven by data. They are controlled by the data input to the system, with relatively little external event processing. Data-driven models show the sequence of actions involved in processing input data and generating an associated output. They are particularly useful during the analysis of requirements as they can be used to show end-to-end processing in a system. Example: Week 8 9 Event-driven Modeling Real-time systems are often event-driven, with minimal data processing. For example, a landline phone switching system responds to events such as 'receiver off hook' by generating a dial tone. Event-driven modeling shows how a system responds to external and internal events. It is based on the assumption that a system has a finite number of states and that events (stimuli) may cause a transition from one state to another. State Machine Models These model the behaviour of the system in response to external and internal events. They show the system's responses to stimuli so are often used for modelling real- time systems. State machine models show system states as nodes and events as arcs between these nodes. When an event occurs, the system moves from one state to another. Statecharts are an integral part of the UML and are used to represent state machine models. Week 8 10 8.3 Architectural Design Overview Architectural Design Architectural design is concerned with understanding how a software system should be organized and designing the overall structure of that system. Architectural design is the critical link between design and requirements engineering, as it identifies the main structural components in a system and the relationships between them. The output of the architectural design process is an architectural model that describes how the system is organized as a set of communicating components. Architectural Representations Simple, informal block diagrams showing entities and relationships are the most frequently used method for documenting software architectures. But these have been criticised because they lack semantics, do not show the types of relationships between entities nor the visible properties of entities in the architecture. Depends on the use of architectural models. The requirements for model semantics depends on how the models are used. Week 8 11 Architectural Abstraction Architecture in the small is concerned with the architecture of individual programs. At this level, we are concerned with the way that an individual program is decomposed into components. Architecture in the large is concerned with the architecture of complex enterprise systems that include other systems, programs, and program components. These enterprise systems are distributed over different computers, which may be owned and managed by different companies. Advantages of Explicit Architecture Stakeholder communication Architecture may be used as a focus of discussion by system stakeholders. So that you can make sure that the stakeholders and the developers are on the same page about how the system should come together. System analysis Means that analysis of whether the system can meet its non-functional requirements is possible. If you think about how you’ll structure the system, that might have implications for performance and reliability. Large-scale reuse Week 8 12 The architecture may be reusable across a range of systems Product-line architectures may be developed. Use of Architectural Models As a way of facilitating discussion about the system design. A high-level architectural view of a system is useful for communication with system stakeholders and project planning because it is not cluttered with detail. Stakeholders can relate to it and understand an abstract view of the system. They can then discuss the system as a whole without being confused by detail. As a way of documenting an architecture that has been designed. The aim here is to produce a complete system model that shows the different components in a system, their interfaces and their connections. 8.4 Architectural Views & Design Decisions Architectural Design Decisions When it’s time to design an architecture, coming out of your requirements for example, you’re thinking about how you’ll actually build it, and the components you might need to represent the requirements. Your Requirements tell you what the system is supposed to do. The Architecture is the first step in deciding how the system will do it. Architectural design is a creative process so the process differs depending on the type of system being developed. However, a number of common decisions span all design processes and these decisions affect the non-functional characteristics of the system. Architecture and System Characteristics Week 8 13 Performance Localise critical operations and minimize communications. Use large rather than fine-grain components. Security Use a layered architecture with critical assets in the inner layers. Safety Localise safety-critical features in a small number of sub-systems. Availability Include redundant components and mechanisms for fault tolerance. Maintainability Use fine-grain, replaceable components If your system is going to be maintainable, then using simpler components will allow them to be replaced easily. However, this directly contradicts Performance. You have decide which one is more important based on the system you are building. You need to answer these questions before you can determine the appropriate architecture for your system. Architectural Views Week 8 14 What views or perspectives are useful when designing and documenting a system's architecture? What notations should be used for describing architectural models? Each architectural model only shows one view or perspective of the system. It might show how a system is decomposed into modules, how the run-time processes interact or the different ways in which system components are distributed across a network. For both design and documentation, you usually need to present multiple views of the software architecture. The suggestion is that System architecture should give a, logical view, physical view, development view and process view: 4 + 1 View Model Logical view: shows the key abstractions in the system as objects or object classes. Process view: shows how, at run-time, the system is composed of interacting processes. Development view: shows how the software is decomposed for development. Physical view: shows the system hardware and how software components are distributed across the processors in the system. Related using use cases or scenarios (+1) Week 8 15 Representing Architectural Views Some people argue that the Unified Modeling Language (UML) is an appropriate notation for describing and documenting system architectures. UML does not include abstractions appropriate for high-level system description.. Architectural description languages (ADLs) have been developed but are not widely used. 8.5 Architectural Patterns Architectural Patterns Patterns are a means of representing, sharing and reusing knowledge. An architectural pattern is a stylized description of good design practice, which has been tried and tested in different environments. Patterns should include information about when they are and when the are not useful. Patterns may be represented using tabular and graphical descriptions. Model-View Controller Week 8 16 Layered Architecture Week 8 17 Built into this pattern is a layer of security, as you cannot access any of the lower layers without first accessing the first layers. Repository Architecture Sub-systems must exchange data. This may be done in two ways: Shared data is held in a central database or repository and may be accessed by all sub-systems. Each sub-system maintains its own database and passes data explicitly to other sub-systems. When large amounts of data are to be shared, the repository model of sharing is most commonly used a this is an efficient data sharing mechanism. Week 8 18 Client-server Architecture Distributed system model which shows how data and processing is distributed across a range of components. Can be implemented on a single computer. Set of stand-alone servers which provide specific services such as printing, data management, etc. Set of clients which call on these services. Network which allows clients to access servers Week 8 19 Pipe and Filter Architecture Week 8 20