Draw (in words) the context diagram for HLAMS, given that the Board keeps its existing accounting package and uses external e-KYC, bank/payment-gateway and SMS services.
System models are abstract views of a system: context models fix its boundary, interaction models show use cases and message sequences, behavioural models show data flows and state changes, and data and object models show structure. UML 2.5 standardises fourteen diagram types.
A system model is an abstract representation of a system from one perspective. It is an abstraction, not an alternative representation: it deliberately leaves out detail to highlight what matters for one purpose — a context model ignores internal processing, a data model ignores timing. Models help the analyst understand the system and give customers and engineers a shared language.
Models help at three points: in requirements engineering, to work out the detailed requirements; in design, to explain the system to the people who will build it; and after implementation, to document how it is structured and how it works. Models of the existing system clarify what it does and where it is weak; models of the new system explain the proposed requirements. A model may be a rough sketch for discussion, careful documentation, or — in model-driven engineering — detailed enough to generate code.
| Perspective | Question it answers | Typical models |
|---|---|---|
| External (context) | Where is the system boundary? What lies in its environment? | Context diagram / level-0 DFD, architectural block diagram, activity diagram of the business process |
| Interaction | How does the system interact with users, other systems — and how do its parts interact? | Use-case diagrams, sequence and communication diagrams |
| Structural | How are the system and its data organised? | Class and object diagrams, ER diagrams, component and package diagrams |
| Behavioural | How does the system respond to data and events while it runs? | DFDs and activity diagrams (data-driven); state machine diagrams (event-driven) |
Older editions of Sommerville name five model types instead: a data-processing model (how data is processed at different stages — DFD), a composition model (how entities are composed of other entities), an architectural model (the principal sub-systems), a classification model (how entities share characteristics — inheritance) and a stimulus–response model (how the system reacts to events — state machines).
Early in requirements engineering you must decide the system boundary — what is inside the system and what is in its environment. The decision is partly technical and partly social: should HLAMS include the Board's general accounting, or only send ledger entries to the existing accounting package? The answer changes cost, requirements and whose jobs change. A context model records the decision by showing the system and the other people and systems it exchanges data with.
+--------------+ registration details, application & documents
| Applicant | ---------------------------------------------->+---------+
| | <----------------------------------------------| |
+--------------+ acknowledgement & status | |
+--------------+ scrutiny decisions | |
| KSHB officer | ---------------------------------------------->| |
| | <----------------------------------------------| |
+--------------+ worklists & MIS reports | |
+--------------+ collection file, payment confirmation | HLAMS |
| Bank/payment | ---------------------------------------------->| (one |
| gateway | | process)|
+--------------+ | |
+--------------+ identity query | |
| e-KYC service| <----------------------------------------------| |
| | ---------------------------------------------->| |
+--------------+ identity response | |
+--------------+ SMS text | |
| SMS gateway | <----------------------------------------------| |
+--------------+ | |
+--------------+ ledger entries | |
| Accounts | <----------------------------------------------| |
| package | +---------+
+--------------+In structured analysis this context diagram is the level-0 DFD: exactly one process standing for the whole system, the external entities (sources and sinks, also called terminators) and the data flows between them. Data stores are internal to the system and normally do not appear at level 0. Pressman calls it the fundamental system model.
Context models show which other systems exist but not how the system is used in the business. Process models fill that gap: a UML activity diagram with swimlanes can show the loan-sanction process — the applicant submits, a clerk scrutinises, the officer verifies, the accounts section disburses — and mark which activities HLAMS automates and which stay manual.
Interaction models show how a system interacts with its environment — user interaction (inputs and outputs), interaction with other systems, and interaction between the system's own components. Use-case diagrams (covered with elicitation) show each discrete task an actor performs with the system. Sequence diagrams then add the detail of one use case: which objects take part and the order of the messages between them.
| Element | Notation | Meaning |
|---|---|---|
| Participant and lifeline | Box at the top (object : Class, or an actor) with a dashed vertical line below | An object or actor that exists during the interaction |
| Activation (execution specification) | Thin rectangle on a lifeline | The period during which the participant is performing an action |
| Synchronous message | Solid line with a filled arrowhead | The sender waits for the call to finish |
| Asynchronous message | Solid line with an open (stick) arrowhead | The sender continues without waiting |
| Reply / return | Dashed line with an open arrowhead | Return of control and, optionally, a value |
| Self-message | Arrow looping back to the same lifeline | An object calling one of its own operations |
| Create / destroy | Message pointing at a new participant box / an X ending a lifeline | Object creation and deletion |
| Combined fragment | Frame labelled alt, opt, loop, par or ref | Alternatives with guards, an optional part, repetition, parallel parts, a reference to another diagram |
Time flows downwards: read a sequence diagram top to bottom. Messages are labelled with operation names and arguments, and guards in [square brackets] decide which operand of an alt fragment runs. A communication diagram (UML 1's collaboration diagram) shows the same interaction with numbered messages (1, 1.1, 1.2 …) on the links between objects — it emphasises structure rather than time. Sequence diagrams are also the main notation for object behaviour models in object-oriented design.
Most business systems are data-driven: what they do is triggered by data coming in, and they handle few external events. Their behavioural models show the sequence of processing steps that turn input data into output. The classic notation is the data-flow diagram (DFD) of structured analysis — Tom DeMarco (1978), Ed Yourdon and Larry Constantine, Chris Gane and Trish Sarson (1979). DFDs are simple and intuitive, so customers can review them, and they show end-to-end processing.
| Element | DeMarco & Yourdon | Gane & Sarson | Naming rule |
|---|---|---|---|
| Process | Circle ('bubble') | Rounded rectangle with an ID (e.g. 2) and a name | Verb phrase — 'Accept application' |
| Data flow | Labelled arrow | Labelled arrow | Noun phrase — 'verified application' |
| Data store | Two parallel lines (open-ended) | Open-ended rectangle with an ID (e.g. D2) | Noun — 'Applications' |
| External entity (source/sink) | Rectangle (square) | Square, often shaded or double-edged | Noun — 'Applicant', 'Bank' |
DFDs are drawn in levels. The context diagram (level 0) has one process. Level 1 expands it into the major processes, numbered 1, 2, 3 … (typically five to nine). Level 2 expands one level-1 process — process 3 becomes 3.1, 3.2, 3.3 — and so on until each process is simple enough to describe in a short process specification (structured English, a decision table or pseudocode). Balancing (Pressman's information-flow continuity) requires the data flows into and out of a parent process to equal the net flows into and out of its child diagram.
| Level-1 process | Inputs (from) | Outputs (to) |
|---|---|---|
| 1 Register applicant | Registration details (Applicant); identity response (e-KYC) | Identity query (e-KYC); applicant record (D1 Applicants) |
| 2 Accept application | Application & documents (Applicant); applicant profile (D1) | Application record (D2 Applications); acknowledgement (Applicant) |
| 3 Scrutinise & sanction | Pending application (D2); scrutiny decision (Officer) | Updated status (D2); sanctioned loan (D3 Loan accounts) |
| 4 Collect payments | Collection file, payment confirmation (Bank/gateway); loan account (D3) | Payment entries (D3); ledger entries (Accounts package) |
| 5 Notify & report | Application status (D2); account data (D3) | SMS text (SMS gateway); status (Applicant); worklists & MIS reports (Officer) |
Event-driven systems respond to events from the environment or from internal timers, with little data processing — a telephone switch reacting to 'receiver off hook' by generating a dial tone, or a lift reacting to a call button. A state machine model describes them: at any moment the system is in one of a finite number of states, and an event (stimulus) may trigger a transition to another state. Statecharts, invented by David Harel (1987), became UML's state machine diagrams.
| Element | UML notation | Meaning |
|---|---|---|
| State | Rounded rectangle | A condition in which the object waits, satisfies some condition or performs an activity |
| Initial pseudostate | Filled black circle | Where the machine starts |
| Final state | Circle with a ring ('bull's eye') | End of the object's life cycle |
| Transition | Arrow labelled event [guard] / action | Fires when the event occurs and the guard is true; the action runs during the transition |
| Internal activities | entry / …, exit / …, do / … inside the state | Actions on entering, on leaving, and ongoing while in the state |
| Composite (super) state | A state containing sub-states | Groups related states; one outgoing transition can leave any sub-state |
| Regions and history | Dashed lines dividing a state; H in a circle | Concurrent sub-machines; resume the last active sub-state |
| From state | Event [guard] | To state | Action |
|---|---|---|---|
| Waiting | Full power | Full power | set power = 600 W |
| Waiting | Half power | Half power | set power = 300 W |
| Full power / Half power | Timer | Set time | get number of seconds |
| Set time | Door closed [time set] | Enabled | display 'Ready' |
| Set time / Enabled | Door open | Disabled | display 'Door open' |
| Disabled | Door closed | Enabled | display 'Ready' |
| Enabled | Start | Operation | lamp on; start countdown |
| Operation | Timeout | Waiting | buzzer; lamp off |
| Operation | Door open | Disabled | stop magnetron |
| Any state | Cancel | Waiting | clear settings |
[start] --submit--> Submitted
Submitted --assign / notify clerk--> UnderScrutiny
UnderScrutiny --docsMissing / send SMS--> AwaitingDocuments
AwaitingDocuments --docsUploaded--> UnderScrutiny
AwaitingDocuments --after(30 days)--> Rejected
UnderScrutiny --verify [eligible]--> Sanctioned
UnderScrutiny --verify [not eligible] / send reason--> Rejected
Sanctioned --disburse / create loan account--> Repaying
Repaying --emiOverdue [overdueCount >= 3] / issue notice--> Defaulted
Defaulted --arrearsCleared--> Repaying
Repaying --finalEmiPaid / issue no-dues certificate--> Closed
Rejected --> [end] Closed --> [end]Most large systems rest on a large database, so modelling its logical structure is central. Semantic data models describe the logical structure of the data a system processes. The most widely used is the entity–relationship–attribute model introduced by Peter Chen in 1976: entities (things of interest), their attributes and the relationships between them, with cardinalities 1:1, 1:N and M:N. UML class diagrams can serve the same purpose.
| Entity | Key attributes | Relationships |
|---|---|---|
| Applicant | applicantId, name, dateOfBirth, annualIncome, category | submits 0..* Application |
| Scheme | schemeCode, name, incomeCategory, openDate, closeDate | receives 0..* Application; contains 0..* Unit |
| Application | applicationNo, date, status | has 1..5 Document; leads to 0..1 Loan; may be allotted 0..1 Unit |
| Loan | loanNo, principal, rate, tenure, emi | has 1..* Instalment |
| Unit (flat/plot) | unitNo, type, area, price | belongs to 1 Scheme |
| Payment | receiptNo, amount, date, mode | settles 1..* Instalment |
A data dictionary is an alphabetic list of the names used in the system models — entities, attributes, relationships, data flows, data stores, processes — with information about each. Typical entry fields are the name, aliases, a description, the type (entity, attribute, relation, process, data flow…) and related items; Sommerville adds the date of entry, Pressman adds where and how the item is used. A data dictionary supports name management — one agreed name per item, so two analysts do not invent different names for the same data — and is a store of organisational information linking analysis, design, implementation and evolution. CASE tools maintain it automatically.
| Name | Aliases | Description | Type | Related items |
|---|---|---|---|---|
| annual_income | income | Total yearly family income of the applicant in rupees, as on the income certificate | Attribute (integer, ₹) | Applicant; determines incomeCategory |
| Application | file, case | A request by one applicant for a loan or allotment in one scheme | Entity | Applicant, Scheme, Document, Loan |
| submits | — | 1:N relationship from Applicant to Application | Relationship | Applicant, Application |
| Accept application | — | Level-1 DFD process 2: validates and stores a new application | Process | D2 Applications, Applicant |
Object models describe a system as a set of object classes and the relationships between them. A class abstracts what a group of objects has in common — the same attributes and the same operations (services); objects are its run-time instances. Object models suit both requirements (real-world entities such as Applicant and Scheme) and design. Sommerville identifies three kinds: inheritance (classification) models, object aggregation models and object behaviour models (usually sequence diagrams).
+---------------------------------------+
| LoanAccount | class name
+---------------------------------------+
| - loanNo : String | attributes:
| - principal : double | visibility name : type
| # rate : double |
| ~ branchCode : String |
+---------------------------------------+
| + computeEmi() : double | operations:
| + postPayment(amount : double) : void | visibility name(params) : return
| - recalculateSchedule() : void |
+---------------------------------------+
+ public - private # protected ~ package| Relationship | Notation | Meaning | HLAMS example |
|---|---|---|---|
| Association | Solid line; optional arrowhead for navigability; role names and multiplicities at the ends | A structural link between instances | Applicant 1 —— 0..* Application |
| Multiplicity | 1 · 0..1 · 0..* · 1..* · m..n (a lone * also means 'many') | How many instances can be linked | An Application has 1..5 Documents |
| Aggregation | Hollow diamond at the whole | Whole–part; parts can exist independently and may be shared | Scheme ◇—— Unit (a unit can move to another scheme) |
| Composition | Filled diamond at the whole | Strong ownership; a part belongs to one whole and is destroyed with it | LoanAccount ◆—— Instalment |
| Generalisation | Hollow triangle pointing to the superclass | 'Is-a' inheritance | GovtEmployeeApplicant —▷ Applicant |
| Dependency | Dashed arrow | One element uses another temporarily (e.g. as a parameter) | ReportService ┈┈> EmiCalculator |
| Realisation | Dashed line with a hollow triangle | A class implements an interface | SmsNotifier ┈┈▷ Notifier |
An object diagram shows instances at one moment: object boxes named 'a1 : Application' (underlined), attribute values (applicationNo = "A-2026-1234", status = SUBMITTED) and the links between them. It is a snapshot used to check a class diagram against a concrete example or to illustrate a complex data structure.
The Unified Modeling Language merged the notations of Grady Booch (Booch method), James Rumbaugh (OMT) and Ivar Jacobson (OOSE) — the 'three amigos' at Rational Software — in the mid-1990s. The Object Management Group (OMG) adopted UML 1.1 in 1997 and UML 2.0 in 2005; the current version is UML 2.5.1 (2017). The earlier UML 2.4.1 was also published as the international standard ISO/IEC 19505 (2012).
| Category | Diagram | Shows |
|---|---|---|
| Structure | Class | Classes, attributes, operations and relationships |
| Structure | Object | Instances and links at one moment |
| Structure | Component | Components and their provided and required interfaces |
| Structure | Deployment | Hardware/execution nodes and the artefacts deployed on them |
| Structure | Package | Grouping of model elements into packages and their dependencies |
| Structure | Composite structure | Internal structure of a class or component — parts, ports, connectors |
| Structure | Profile | Stereotypes and extensions that tailor UML to a domain |
| Behaviour | Use case | Actors and the use cases they take part in |
| Behaviour | Activity | Flow of actions, decisions, forks/joins and swimlanes |
| Behaviour | State machine | States of an object and the transitions between them |
| Behaviour → interaction | Sequence | Messages between lifelines, ordered in time |
| Behaviour → interaction | Communication | Numbered messages on links between objects (UML 1: collaboration diagram) |
| Behaviour → interaction | Timing | Changes of state or value along a time axis, with timing constraints |
| Behaviour → interaction | Interaction overview | An activity-like flow whose nodes are interactions |
Model-driven engineering (MDE) makes models, not programs, the principal outputs of development; programs are generated from the models. The OMG's Model-Driven Architecture (MDA, 2001) moves from a computation-independent model (CIM) of the domain, to a platform-independent model (PIM) of the system, to one or more platform-specific models (PSMs) — e.g. for Java EE or .NET — and then to code, using automated transformations. Executable UML uses a subset of UML (class, state and activity models) with an action language. MDE raises the level of abstraction, but depends heavily on tools and suits some parts of a system better than others.
Try the problem first, then reveal the working one step at a time.
Draw (in words) the context diagram for HLAMS, given that the Board keeps its existing accounting package and uses external e-KYC, bank/payment-gateway and SMS services.
A draft level-1 DFD shows: (a) a flow from data store D2 Applications straight to data store D3 Loan accounts; (b) a flow from the external entity Bank straight into D3; (c) process 6 'Archive files' with an input from D2 but no output; (d) process 7 'Generate letters' with an output to Applicant but no input; (e) the context diagram shows 'scrutiny decisions' from Officer, but no level-1 process receives it. Identify each error and fix it.
Using the LoanApplication state machine in this topic, trace the state after each event: submit, assign, docsMissing, docsUploaded, verify (applicant eligible), disburse, emiOverdue (overdueCount = 1), emiOverdue (overdueCount = 3), arrearsCleared, finalEmiPaid.
Model these facts: (i) an applicant can submit many applications, each by exactly one applicant; (ii) each application has between one and five documents, which mean nothing without it; (iii) a scheme groups housing units, but a unit can be transferred to another scheme; (iv) a government-employee applicant is a special applicant who also has a salary certificate; (v) ReportService uses EmiCalculator only inside one method.
On a level-1 DFD, process 3 has inputs 'pending application' and 'scrutiny decision' and output 'sanctioned loan'. Its level-2 child diagram (3.1, 3.2, 3.3) has external inputs 'pending application', 'scrutiny decision' and 'credit score', and external output 'sanctioned loan'. Is the diagram balanced? How would you fix it?
Interpret: 'Scheme 1 ◇—— 0..* Unit' and 'Unit 0..1 —— 0..1 Application' (the allotment link). (a) Can a unit exist without a scheme? (b) Can one application be allotted two units? (c) Can a unit be allotted to two applications?
Name the UML diagram that best shows: (a) the order of messages when an EMI payment is processed; (b) which servers host the portal, application and database; (c) the life cycle of a loan account; (d) the business process of sanction with swimlanes for clerk, officer and accounts; (e) the classes Applicant, Application and Loan with their associations; (f) the system's actors and the tasks they perform.
Write data-dictionary definitions in DeMarco notation for: (a) a postal address with an optional landmark and either a PIN code or a 'PIN awaited' flag; (b) a repayment schedule consisting of 1 to 240 instalments, each with due date, principal part and interest part.
For the microwave-oven state machine in this topic: (a) which state is reached if the door is opened while cooking? (b) what must happen before the oven can be started again? (c) why is this a safety property?
12 questions. 70 % passes the topic quiz (+30 XP, +20 more for 100 %). Exam scoring: +1 correct, −⅓ wrong.
Modelled on real KPSC questions (reworded) with the same concept and answer; each links to its original paper.