Lecture: System Modeling
1. Introduction to System Modeling
Definition:
System modeling is the process of creating abstract representations (models) of a software system to
understand, analyze, and communicate its structure, behavior, and functionality.
Purpose of System Modeling:
o To visualize system requirements and behavior.
o To communicate ideas among stakeholders.
o To identify potential design and implementation issues early.
o To serve as documentation for future reference and maintenance.
2. Importance of System Modeling
Helps in bridging the gap between user requirements and system design.
Provides a foundation for system analysis, design, and implementation.
Enables effective communication among stakeholders, including clients, developers, and testers.
Reduces ambiguity and enhances clarity by using visual diagrams and structured representations.
3. Key Concepts in System Modeling
1. Abstraction:
Focus on essential details while omitting irrelevant complexities.
2. Viewpoints:
o Structural View: Focuses on the static aspects, such as system components and relationships (e.g.,
class diagrams).
o Behavioral View: Focuses on dynamic aspects, such as system operations over time (e.g., sequence
diagrams).
3. Models:
Representations of the system from different perspectives to address specific concerns.
4. Types of Models in System Modeling
1. Context Models:
o Illustrate the environment in which the system operates and its interactions with external entities.
they show what lies outside the system boundaries.
System boundaries are established to define what is inside and what is outside the system.
o Example: Context Diagram (shows system boundaries and external actors).
The diagram below shows the main system at the centre, MHC-PMS (Mental Health Care Patient
Management System). This system can be used in clinics and help them maintain patients' records. It comprises various
sub-systems: the Patient Record System, Admission System, Prescription System, Appointments
System, HC Statistics System, and Management Reporting System. These sub-systems are connected
to the main system. These sub-systems support and work with the main system.
2. Interaction Models:
o Represent interactions between components or between the system and its users.
three types of interactions:
1. User interaction
2. System interaction
3. Component interaction
o Examples: Use Case Diagrams, Sequence Diagrams, Collaboration Diagrams.
there are five use cases: Register Patient, Unregister Patient, Transfer
Data, View Patient Information, and Contact patient. All roles are
played by the medical receptionist.
the medical receptionist sends a request along with the patient ID and PID to the object class "P:
PatientInfo" to view information about the patient. From the instant "P" request is sent along with
the PID (patient ID) and UID (user ID) to the database of MHC-PMS. From MHC-PMS, the
information is not directly provided to the medical receptionist, but first authorization takes place.
3. Structural Models:
o Represent the static structure of the system, including its components and relationships.
o Examples: Class Diagrams, Component Diagrams, Deployment Diagrams.
The classes are Condition, Consultant, Patient, General Practitioner,
Consultation, Medication, Treatment, and Hospital Doctor.
4. Behavioral Models:
o Represent the dynamic behavior of the system, such as workflows, processes, and state changes.
There are two types of behavioral models:
1. Data-driven modeling
It means data that comes in has to be processed by the system.
2. Event-driven modeling
It means that an event occurs that triggers the system
o Examples: Activity Diagrams, State Diagrams.
5. Unified Modeling Language (UML)
Definition:
UML is the standard language used for system modeling. It provides a set of diagrams and notations
for representing different views of the system.
Key UML Diagrams:
o Structural Diagrams: show
the things in the modeled system. In a more technical
term, they show different objects in a system.
Class Diagram, Object Diagram, Component Diagram, Deployment Diagram.
o Behavioral Diagrams: show what should happen in a system.
Use Case Diagram, Activity Diagram, State Diagram, Sequence Diagram.
6. Common System Modeling Diagrams
1. Use Case Diagram
Purpose: Represents the functionality of the system from a user’s perspective.
Components:
o Actors: Users or external systems interacting with the system.
o Use Cases: Functionalities or services provided by the system.
o Relationships: Associations between actors and use cases.
2. Class Diagram
Purpose: Represents the static structure of the system.
Components:
o Classes: Represent system entities.
o Attributes: Properties of a class.
o Methods: Operations performed by a class.
o Relationships: Associations, inheritances, dependencies.
3. Sequence Diagram
Purpose: Represents the flow of messages and interactions between objects over time.
Components:
o Objects: Entities participating in the interaction.
o Lifelines: Represents the object's lifecycle.
o Messages: Arrows showing communication between objects.
4. Activity Diagram
Purpose: Represents workflows or processes within the system.
Components:
o Activities: Tasks performed.
o Transitions: Arrows showing the flow between activities.
o Decision Points: Branching logic in workflows.
5. State Diagram
Purpose: Represents the states of a system or object and transitions between them.
Components:
o States: Different conditions of an object.
o Transitions: Triggers causing state changes.
7. Process of System Modeling
1. Identify System Requirements:
Gather functional and non-functional requirements from stakeholders.
2. Define System Boundaries:
Use context diagrams to identify the system’s scope and its interactions with external entities.
3. Choose Modeling Techniques:
Select appropriate diagrams to represent structural and behavioral aspects.
4. Develop Models:
Create detailed diagrams to represent different perspectives of the system.
5. Validate Models:
Ensure models are accurate, complete, and align with stakeholder needs.
6. Refine and Iterate:
Update models based on feedback and changes in requirements.
8. Tools for System Modeling
1. Diagramming Tools:
o Lucidchart, draw.io, Microsoft Visio.
2. UML Tools:
o StarUML, Enterprise Architect, Visual Paradigm.
3. IDE Integration:
o Tools like Eclipse and IntelliJ IDEA provide plugins for UML modeling.
4. Collaborative Tools:
o Figma, Miro for collaborative modeling sessions.
9. Benefits of System Modeling
1. Improved Communication:
Enhances collaboration between technical and non-technical stakeholders.
2. Risk Mitigation:
Identifies potential issues early in the development process.
3. Documentation:
Provides a reference for future development and maintenance.
4. Problem Solving:
Helps analyze and resolve design issues.
5. Streamlined Development:
Ensures all team members share a common understanding of the system.
10. Challenges in System Modeling
1. Complexity:
Large systems may require numerous models, leading to potential confusion.
2. Tool Dependency:
Some tools have steep learning curves or limited features.
3. Stakeholder Understanding:
Non-technical stakeholders may struggle to interpret technical diagrams.
4. Maintaining Accuracy:
Models must be updated regularly to reflect changes in requirements or design.
11. Example: System Modeling for an Online Shopping System
Use Case Diagram:
Actors: Customer, Admin, Payment Gateway.
Use Cases: Browse Products, Add to Cart, Checkout, Make Payment, Manage Inventory.
Class Diagram:
Classes: Product, Cart, Customer, Order.
Attributes: Product (name, price, stock), Customer (name, email).
Relationships:
o A Customer can place multiple Orders.
o A Cart contains multiple Products.
Sequence Diagram:
Scenario: Customer places an order.
o Customer selects a product → Adds to cart → Proceeds to checkout → Makes payment.
12. Conclusion
System modeling is a critical aspect of software engineering that simplifies understanding, designing, and
communicating complex systems. By leveraging models and diagrams, software teams can ensure better
alignment with stakeholder needs, reduce development risks, and streamline the software development
lifecycle.
Discussion Questions
1. What are the key differences between structural and behavioral models?
2. How can system modeling help in Agile development processes?
3. Can you think of a situation where a missing or incorrect model caused project delays or failures?