Software Architecture
Until now the course has designed individual objects. Architecture steps back to the large scale: which requirements shape the whole system, how to decide and record the big choices, and how to organise the software into layers and packages. Question 6 of the exam (20 of 120 marks) is entirely about this.
- You will be able to define architecture and architectural analysis, and explain why the analysis matters.
- You will spot architecturally significant requirements, justify them, and write quality scenarios and factor-table rows.
- You will write a full technical memo, the exact format of exam Q6.2.
- You will draw layered package diagrams, apply Model-View Separation, and read component and deployment diagrams.
What Software Architecture Is exam
Weeks 3 to 9 of the course designed objects one at a time with GRASP and the GoF patterns, almost all of them in the application logic. That leaves a bigger question unanswered: how do the large pieces of a system fit together, and which early choices will be painful to undo? Architecture is the name for that large-scale view.
In both 2021 papers, Q6 is worth 20 of 120 marks and is purely about architecture. It comes in two halves of 10 marks each.
- Q6.1 gives you a numbered system description. You pick two architecturally significant requirements, one functional and one non-functional, then describe architectural analysis using the scenario as your example, say why it matters, and justify why your two requirements are significant.
- Q6.2 asks for a technical memo on one of the two, under the headings Factors / Solution / Motivation / Unresolved Issues / Alternative Solutions, with plausible invented details and a reasoned architectural argument.
Layers, package diagrams and Model-View Separation are also examinable (they are lecture learning outcomes), and they feed the memo's Solution box. The Week 12 review lists architectural analysis, architecturally significant requirements, the factor table and the technical memo among the key topics, and says component diagrams are unlikely to be examined. The sources are the Week 10 lecture, Workshop 10 and Larman chs. 13, 33 and 34 (plus parts of 35, 38 and 39); the Week 11 lecture adds the Chauffeured Cars case study (§8.11).
One colour code runs through every layer diagram on this page, so you can tell at a glance where something lives: UI, Application, Domain, Technical Services and Foundation or external.
Two definitions that fit together
Course definition (lecture): software architecture is the large-scale organisation of elements in a software system. The aim is a design that meets the high-impact requirements, supports the business logic, and is easy to maintain and evolve.
Larman's definition (taken from Booch, Rumbaugh & Jacobson): an architecture is "the set of significant decisions about the organization of a software system".
Larman's definition talks about decisions, so it is natural to ask what the decisions are about. The lecture names four decision areas, plus the overall architectural style that guides them. The figure lays them out with the question each answers and an example from the NextGen point-of-sale (POS) system, the textbook's running example.
Architectural decisions, and why they are hard to change exam
An architectural decision is a large-scale or fundamental design choice. Typical examples are which layers and subsystems exist and how they communicate, whether to buy or build, which application server or database to use, where the system is deployed, and how failover works. What makes these different from ordinary design choices is that they are hard to change later, for four reasons.
Because the decisions are so costly to reverse, architectural factors must be identified early, during Unified Process (UP) inception and early elaboration, and the rationale must be recorded in technical memos (§8.5) so that future maintainers know why a choice was made before they change it. Larman gives two requirements that become costly if left until late: "must support English, Chinese and Hindi" and "500 concurrent transactions at one-second average response". Neither can be bolted on at the end: one touches every screen and string, the other the whole deployment.
Why architecture matters: the two cartoons
The lecture (slide 6) makes the point with two cartoons. In the first, a team designs from a partial set of requirements and ends up with an unstable, bolted-on structure. In the second, a team builds the pieces (data, API, cache, security, UI) without focusing on the business logic, and then finds that the business-logic piece does not fit. Architecture guards against both failures: it brings in the high-impact requirements early and keeps the business logic at the centre.
Logical architecture versus deployment architecture
An architecture can be described from two angles, and keeping them apart avoids a classic exam mistake. The logical architecture is how the software classes are organised into packages, subsystems and layers. It is called "logical" because it makes no decisions about processes, operating systems or physical computers. Those belong to the deployment architecture, which places the software on processes and physical nodes, drawn with UML deployment diagrams (§8.9).
This also explains where Week 10 sits in the course. Weeks 3 to 9 focused on objects in the application logic (domain) layer, through GRASP and GoF (Part IV, Part VI). Week 10 takes the holistic view and asks how the domain layer fits with the UI and technical-service layers.
Check yourselfWhich of these are architectural decisions? (a) using MySQL rather than a paid database; (b) naming a method getTotal; (c) splitting the system into UI, Domain and Technical Services layers; (d) buying a tax-calculation package rather than writing one.
(a), (c) and (d). Each is large-scale and hard to reverse: (a) is a choice of external product with licensing and platform commitments, (c) decides the structural elements and their composition, and (d) is a buy-versus-build decision. (b) is a local, cheap-to-change detail inside one class, so it is ordinary object design.
Check yourselfA colleague says "our logical architecture is a web server, an app server and a database server". What is wrong with that?
Those are physical nodes, which belong to the deployment architecture. A logical architecture organises software classes into packages, subsystems and layers and makes no decisions about computers, processes or operating systems. The logical answer would be something like UI, Domain and Technical Services layers; the deployment model then maps those layers onto the three servers.
- Architecture is the large-scale organisation of a system: the significant decisions about structural elements, interfaces, collaboration and composition, guided by an architectural style.
- Those decisions are hard to change (fan-in, scattered assumptions, external commitments, everything built on top), so find the factors early and record the rationale.
- The logical architecture (packages, layers) is separate from the deployment architecture (nodes, processes).
Architectural Analysis exam
If architectural decisions are expensive to reverse, you want to know before you make them which requirements will push the design around. Architectural analysis is the activity that finds those requirements, works out how much they vary and how much they matter, and then resolves them. Q6.1 asks you to describe it, so learn the vocabulary in this section precisely.
Larman: architectural analysis is concerned with the identification and resolution of the system's non-functional requirements in the context of the functional requirements.
Lecture: an activity to identify factors that will influence the architecture, understand their variability and priority, and resolve them.
So architectural analysis is a specialisation of requirements analysis, focused on the requirements that strongly influence the architecture. In UP terms it covers two halves: architectural investigation (the identification) and architectural design (the resolution). Keep both halves in mind; an exam answer that only identifies factors and never resolves them loses marks.
Variation points and evolution points
Besides the architecturally significant requirements themselves, the analysis looks for two kinds of variation, because variation is what forces you to design in flexibility. The difference between them is simply whether the variation is in today's requirements or only a guess about tomorrow.
Why architectural analysis is important (Larman's three reasons) exam
Q6.1 asks why the analysis matters, and Larman gives exactly three reasons. Learn them as a set, and in the exam give each one a concrete example from the scenario.
Reduce the risk of missing something central
A critical factor found late means expensive rework, or even project failure.Avoid effort on low-priority issues
Effort goes to the high-priority, high-impact factors instead. "Pick your battles."Align the product with business goals
Time-to-market, target customers, legal obligations and cost.Architecturally significant requirements
Lecture: a requirement that can have a large impact on the design, especially if it was not considered at the beginning. The UP and Larman use the same name for requirements with architectural implications, and Larman shortens it to factors. So ASR = architectural factor = architectural driver: three names for one idea.
Any FURPS+ category can be a factor, including schedule, skills and cost. Larman's example is a project with a tight schedule and limited skills but enough money: that combination favours buying or outsourcing over building in-house. In practice the strongest influences tend to come from Functionality, Reliability, Performance and Supportability, and from the "+" categories Implementation and Interface. Usually it is the non-functional quality attributes, more than the functional requirements, that give an architecture its particular character. Many factors are also constraints, for example "must run on Linux" or "third-party component budget is X".
FURPS+ (from Part I) doubles as a checklist: walk through its categories and, in each one, look for requirements with architectural impact. The figure lists the typical finds.
The lecture also gives its own lists of examples. Most of the functional ones are cross-cutting services that many features use, and that is exactly why they shape the architecture: you cannot add a printing or auditing service to one class at a time.
Auditing (audit trails), Licensing, Localization, Mail, Online help, Printing, Reporting, Security (protecting access to resources or information), System management, Workflow.
Usability (UI aesthetics and consistency); Reliability (availability, accuracy, recovery); Performance (throughput, response, recovery, start-up and shutdown time); Supportability (testability, adaptability, maintainability, compatibility, configurability, installability, scalability, localizability).
How one answer can change the design
The lecture (slide 12, Larman §33.3) shows why these requirements matter with four NextGen questions. Each can be answered either way, and the answer changes the design significantly.
- Reliability and fault tolerance. If a remote service such as the tax calculator fails, may the POS fail over to a local service? If so, is the local service identical or simplified?
- Adaptability and configurability. To sell to many retailers whose business rules differ, can the retailers change the rules themselves? Should the POS be configurable, or customised by programmers for each sale?
- Branding. Retailers want their own brand in the UI. Can the branding be changed without code changes? (This is the Windows XP lesson again.)
- Licensing cost. A commercial database that charges 2% per sale gives speed and robustness. Is it worth that, compared with a less robust free one?
Justifying that a requirement is significant: WIDEST exam
Q6.1 asks you to justify why your two requirements are architecturally significant. "It is important to users" earns nothing; the marker wants to see why the architecture changes. Give at least three of the reasons below and tie each one to the scenario. The mnemonic WIDEST is the study guide's own, not the course's.
By contrast, "the default font size is 12 pt", "record the patient's date of birth" and "the delete button is red" are not architecturally significant. They are local and cheap to change, and they are handled inside one class or one screen. Run them through WIDEST and none of the six letters applies.
Practice: the lecture's LMS poll
The lecture polls the class on which requirements for a new learning management system (LMS) are architecturally significant. The slides give no answer, so the sort below is the guide's reasoned one.
Check yourselfFor a hospital app, is "every prescription must be checked against the national drug-interaction database" architecturally significant? Give WIDEST reasons.
Yes. External: it depends on a system we don't control, so it needs an adapter and a plan for when that system is down. Inflexible: it is a safety requirement, so it is top priority. Trade-offs: a remote check on every prescription affects performance and availability. Three reasons tied to the scenario is what the mark scheme rewards.
The process: two common steps exam
The analysis happens in early elaboration, although some factors were already recorded during inception: in the Supplementary Specification, in the Special Requirements and Technology Variations sections of the use cases, and in Open Issues. From there, the work has two common steps. Step through the loop below.
- Before analysis starts, inception has already captured some factors: in the Supplementary Specification, in the use cases' Special Requirements and Technology Variations sections, and in Open Issues.
- Step 1: identify and analyse the architectural factors. These are the requirements with architectural impact. Non-functional ones get thorough attention; functional ones matter especially for their variability. This step overlaps with ordinary requirements analysis.
- For each factor, record its quality scenarios, variability, impact, priority and difficulty/risk in a factor table (§8.3). The table lives in the Supplementary Specification.
- Step 2: for the factors with significant impact, analyse alternatives and create solutions. Resolve them in priority order: inflexible constraints first, then business goals, then other goals.
- The range of possible decisions is wide. You might remove the requirement, build a custom solution, buy a product, hire an expert, or even stop the project.
- The solutions chosen are the architectural decisions. Each is recorded in a technical memo (§8.5), and the memos are kept in the Software Architecture Document (SAD).
- It is a loop, not a phase. In the iterative UP, the analysis is revisited every iteration and before each new release, as new factors appear and old ones change.
Priorities used in resolving factors
Not every factor can win. Larman (§33.7) and the lecture (slide 14) give a fixed order of priority, and the Priority for success column of the factor table should reflect it.
Four themes of architectural analysis
The lecture sums the activity up in four themes (Larman §33.8). They are a good checklist for the "describe architectural analysis" part of Q6.1.
Mostly non-functional
…but with awareness of the business context. Functional requirements provide the context, and their variability is architecturally significant.System-level and broad
The problems are large-scale, and resolving them needs fundamental decisions, such as whether to use an application server at all.Interdependencies and trade-offs
Security against performance or usability, and nearly everything against cost.Generate and evaluate alternatives
Including buying or reusing third-party hardware and software, not only building.Architecture in the UP: iterative, not waterfall
Check yourselfA student writes: "Architectural analysis is identifying the non-functional requirements." What is missing?
Two things. First, it only covers identification; architectural analysis also understands variability and priority and resolves the factors (architectural design, recorded in technical memos). Second, it handles NFRs in the context of the functional requirements, and functional requirements can themselves be factors, especially for their variability. A full answer: "identifying the factors that influence the architecture, understanding their variability and priority, and resolving them".
Check yourselfA requirement says "the app must support payment by any of the three card providers our clients use; more providers may be added in future". Which part is a variation point and which an evolution point?
"Any of the three providers" is a variation point: the variation exists in today's requirements, so you must design for it (for example a common interface with an adapter per provider). "More providers may be added" is an evolution point: speculative future variation. Here the same adapter design protects against both, cheaply.
Check yourselfGive Larman's three reasons why architectural analysis is important, in one line each.
(1) It reduces the risk of missing something centrally important, which would mean expensive rework or failure. (2) It avoids excessive effort on low-priority issues ("pick your battles"). (3) It aligns the product with business goals such as time-to-market, target customers, legal obligations and cost.
- Architectural analysis identifies the factors (ASRs), understands their variability (variation points now, evolution points later) and priority, and resolves them.
- Two steps: identify and analyse factors into a factor table; resolve the significant ones into decisions recorded in technical memos. Priority: constraints, then business goals, then others.
- Justify significance with WIDEST; it matters because it avoids missing critical factors, focuses effort and aligns with business goals.
Quality Scenarios and the Factor Table exam
"The system will be easy to modify" sounds like a requirement, but nobody can ever prove it has been met, so it gives the architect nothing to design against. A quality scenario fixes that by making a quality requirement measurable, or at least observable, so that it can be tested. The factor table then collects each factor, its scenarios and everything else you need to know about it in one place.
The anatomy of a quality scenario
<stimulus> <measurable response>, plus the environment or conditions it applies to. The stimulus is the event that happens; the measurable response is what the system does, with a number attached.
A few rules make a scenario worth writing.
- A scenario is only valid once it is testable, which means fully specified. Vague words like "most" and "average" must be defined.
- State the environment, such as production or normal load, because a test in a lightly loaded development environment proves little.
- Pick your battles. Write scenarios only for the make-or-break qualities, and have a plan to actually test them. Examples are fast transactions under high load for an airline reservation system, and failover to local services for NextGen.
- Start with the wish as a stakeholder might say it. It names a quality but gives nothing to test: recover how fast, and under what load?
- Stimulus: name the event that triggers the requirement. Here, a remote service (such as the tax calculator) fails.
- Response: say what the system must do in reply: re-establish connectivity with the remote service.
- Measure: attach a number. Within 1 minute of the service being detected as available again. Together with the response, this is the measurable response.
- Environment: under normal store load, in production. Without this, a test on a quiet development machine could "pass" meaninglessly.
- The finished scenario is NextGen's own, from the factor table below. It is testable, states its environment, and is worth writing because recovery is make-or-break for retailers.
"When [event/stimulus] occurs under [conditions], the system [response] within [measure] in [x]% of cases, verified by [test or audit]." Put one in your Q6.1 answer (in Step 1 of the analysis) and one in the Factors box of your Q6.2 memo.
Check yourselfTurn "the booking site must be fast" into a quality scenario using the template.
One possible answer: "When a customer submits a search for available rooms (stimulus) under peak holiday load in production (conditions), the system returns the first page of results (response) within 2 seconds (measure) in 95% of cases, verified by a load test before each release." The numbers are your own invention, which is fine; what matters is that every part is present and nothing is vague.
The architectural factor table
Once you have factors and scenarios, you need somewhere to record them alongside their variability, impact, priority and risk. That is the factor table. In the UP it lives in the Supplementary Specification, with the factors grouped under FURPS+ category headings such as Reliability—Recoverability. It has six columns.
The course's worked example (NextGen POS)
The lecture (slide 16) and Larman's Table 33.1 fill in one complete row under the heading Reliability—Recoverability. Read across it to see how each column is filled in. The next three rows are Larman's other NextGen factors from Table 33.2, useful as patterns to copy; the guide gives only the parts shown for those.
| Factor | Measures & quality scenarios | Variability (current flexibility and evolution) | Impact on stakeholders, architecture, other factors | Priority | Difficulty / risk |
|---|---|---|---|---|---|
| Reliability—Recoverability | |||||
| Recovery from remote service failure | When a remote service fails, re-establish connectivity within 1 minute of its detected re-availability, under normal store load in production. | Current flexibility: the subject-matter expert (SME) says simplified local client-side services are acceptable, and desirable, until reconnection. Evolution: within 2 years some retailers may pay for full local replication (e.g. of the tax calculator). Probability high. | High impact on the large-scale design. Retailers really dislike remote failures because they stop sales. | H | M |
| Other NextGen rows (Table 33.2) | |||||
| Support many third-party services (tax, inventory, HR, accounting) | A new one can be integrated within 10 person-days. | The services vary per installation. | … | H | L |
| Support wireless PDA terminals? | Adding them requires no change to the non-UI layers. | Not needed now, but very likely within 3 years. | … | L | H |
| Legal: current tax rules must be applied | An auditor finds 100% conformance, and rule changes are operational within the government's deadline. | … | Non-compliance is a criminal offence. Building our own would be hard, but buying a package is low risk. | H | L |
Two details reward a second look. The wireless-terminal row is an evolution point written as a factor: its scenario ("no change to the non-UI layers") is really a demand for Model-View Separation and layering (§8.7). And the legal row shows how difficulty depends on the decision you expect: building a tax engine would be hard, but buying one makes the risk low.
Exam-style rows for the past-paper scenarios
These two rows show what a factor table looks like in a Q6 answer, using the 2021 scenarios worked in full in §8.10. The details are invented but plausible, which the exam explicitly allows.
| Factor | Measures & quality scenarios | Variability | Impact | Pri. | Diff. |
|---|---|---|---|---|---|
| Legal—Financial records (Sportsy S4) | When an auditor reconciles any period against bank and payment-provider statements, 100% of transactions are present with amount, time, parties, purpose and provider reference, and none has been edited or deleted. | Current: format is flexible, completeness is not. Evolution: clubs will want export to accounting packages within 2 years (high). | Club officials are legally liable. Touches every money-handling feature. Interacts with reliability and security. | H | M |
| Security—Confidentiality (Doctar S5) | When a non-doctor requests consultation notes through any client or API, access is denied and logged 100% of the time (automated tests each release). Stolen database files are unreadable without keys. | Current: the role set is fixed (doctor, health professional, admin). Evolution: new roles and stricter privacy rules are likely. | Breach causes legal penalties and loss of trust. Cross-cuts all layers. Trades off against usability and performance. | H | H |
Check yourselfIn which column of the factor table does each of these go? (a) "within 2 years some retailers may pay for full local replication"; (b) "retailers really dislike remote failures"; (c) "the SME says simplified local services are acceptable".
(a) Variability, evolution part (a likely future change, with its probability: high). (b) Impact, on stakeholders. (c) Variability, current flexibility part (how much leeway exists now).
Check yourselfWhy does the wireless-PDA factor get priority L but difficulty H, while the legal tax factor gets priority H but difficulty L?
Priority follows the hierarchy: the PDA terminals are only a speculative future need, so low priority, whereas legal compliance is an inflexible constraint, so high priority. Difficulty is about how hard the factor is to achieve: keeping all non-UI layers untouched when a new device type arrives is hard, while tax compliance becomes low risk because a package can be bought. The two columns are independent, which is why the table keeps them separate.
- A quality scenario is
<stimulus> <measurable response>plus the environment; it must be testable, with no vague words. Write them only for make-or-break qualities. - The factor table has six columns: Factor; Measures & quality scenarios; Variability (current flexibility, evolution + probability); Impact (stakeholders, architecture, other factors); Priority (H/M/L); Difficulty or risk (H/M/L). It lives in the Supplementary Specification.
Resolving Factors: Architectural Design Principles
The factor table tells you what the architecture must cope with; it does not tell you how. Resolving the factors is where the actual design happens, and Larman is honest that it is partly a craft. This section collects the principles and the standard mechanisms you will reach for, especially when you fill in the Solution box of a technical memo.
Larman separates the two halves of the work. The science is collecting and organising the factors, which is what the factor table does. The art is making skilful choices that resolve them, weighing trade-offs, interdependencies and priorities. Note that one decision, and so one memo, may resolve several factors at once.
The same principles as object design, at a larger grain
The principles that guided object design in Part IV still dominate: Low Coupling, High Cohesion and Protected Variations (achieved through interfaces, indirection, service lookup and so on). The difference is that at this level they apply between subsystems, applications and processes rather than between small objects, and there are extra mechanisms available, such as messaging services, application servers and configuration files.
One idea is especially architectural: bind late where change is expected. At this level, protected variation often means choosing the concrete implementation at configuration time or run time instead of fixing it in the code. Larman's mechanisms for this are shown below.
Separation of concerns and cross-cutting concerns exam
Separation of concerns is the large-scale way of thinking about low coupling and high cohesion: each "thing" deals with one concern. Application-logic objects contain only application logic, the persistence subsystem only persistence, and the security subsystem only security.
A cross-cutting concern is one with wide application or influence across the system, such as persistence, security, logging and auditing. If you weave such a concern into every domain class, those classes lose cohesion and gain coupling, so it needs handling separately.
The lecture (slide 39) and Larman (§33.7) give three techniques for handling a cross-cutting concern. Know all three by name; the first is by far the most common.
Under- versus over-engineering
Evolution points call for judgement, because protecting against change costs effort now. Designing for every speculative evolution point is expensive and often wrong: over-engineering. Ignoring a likely one can be disastrous: under-engineering, of which Y2K is the classic case. Larman's rule for deciding is to estimate what the change would cost later, when it is actually needed.
A menu of architectural mechanisms
This table pairs each common type of factor with the solution typically used for it, and links each solution back to the patterns of Part IV and Part VI. When you write the Solution box of a memo, find the row that matches your factor and draw on it.
| Factor type | Typical architectural solution | Pattern link |
|---|---|---|
| External services that vary between installations | Common interface + Adapter per vendor, created by a ServicesFactory | Protected Variations, Indirection, Adapter, Factory |
| Unreliable remote services | Proxy that fails over to a local simplified service and retries the remote one; local cache; store-and-forward | Proxy, Adapter |
| Access to a complex subsystem | One Facade with a few coarse-grained operations | Facade |
| Cross-cutting (security, audit, persistence, logging) | A separate Technical Services subsystem behind a facade; Decorator or container; AOP | Pure Fabrication, Facade, Decorator |
| Several user interfaces or devices; usability | Model-View Separation; an Application layer of controllers or session facades; Observer for pushing updates to the UI | Controller, Observer |
| Business rules or branding that vary per customer | Data-driven configuration; Strategy; rule engine behind a facade | Strategy, Protected Variations |
| Performance or scalability | Caching; coarse-grained remote interfaces; distributing the Domain or Technical Services layers; asynchronous messaging | — |
| Tight schedule or limited skills | Buy, reuse or outsource components; cut scope ("remove the requirement") | — |
| Legal compliance | Buy a certified or maintained package, or build a dedicated audited subsystem; test conformance | — |
Check yourselfAn app must write an audit record for every change to customer data, in about forty different operations. Which of the three cross-cutting techniques would you pick, and what goes wrong if you use none?
The usual choice is technique 1: an Audit subsystem in Technical Services, called through an AuditFacade. (A decorator or container around the controllers, or an aspect, would also be acceptable answers if justified.) Using none means forty classes each contain their own audit code: cohesion drops, every class is coupled to the audit storage, and it is easy to miss one path, which for an audit trail is exactly the failure that matters.
Check yourselfA team wants to abstract every class behind an interface "in case we ever switch from Java's ArrayList". Good architecture?
No: over-engineering. The Java libraries are stable, so coupling to them is not a problem; protection is only needed against unstable variation and evolution points. And even for a real evolution point, if the change later would cost only a few person-weeks, Larman says defer it.
- Resolving factors applies Low Coupling, High Cohesion and Protected Variations between subsystems; bind late (interfaces + factory/lookup, configuration, rule engines) where change is expected.
- Separate concerns. Handle cross-cutting concerns by (1) a separate subsystem behind a Facade (most common; layers do this), (2) decorators/containers, or (3) post-compilers/AOP.
- Pick your battles: protect an evolution point only if changing later would be costly; coupling to stable things is fine.
Technical Memos exam
An architectural decision that nobody wrote down is a trap for whoever maintains the system next: they see an odd design, "simplify" it, and reintroduce the problem it solved. A technical memo prevents that by recording each decision together with its reasons. Q6.2 asks you to write one, so this section is worth knowing in detail.
A record of one architectural decision. It sets out the issue, the factors it resolves, the solution, the motivation (rationale), any unresolved issues, and the alternatives considered. Other methods call the same thing issue cards or architectural approach documents. In the UP, memos are kept in the SAD.
The motivation and the rejected alternatives are the most valuable parts. When a future architect needs to change the system, they need to know why this approach was chosen and why the others were rejected, so they can reconsider those alternatives intelligently. The exact format is not important; record whatever helps a future reader make an informed change.
Structure: textbook versus exam
Larman and the lecture give a memo seven parts; the 2021 exam answer boxes have only five. The figure shows how they line up, and where the two "missing" parts go.
What good content looks like in each box exam
The marks reward a reasoned architectural argument. For each box, here is the difference between a good answer and a weak one.
| Box | A good answer gives… | A weak answer… |
|---|---|---|
| Factors | The ASR with its scenario sentence number and FURPS+ category; the related factors it also resolves or trades off against; one quality scenario; its priority and risk. | just restates the requirement word for word. |
| Solution | Concrete architectural mechanisms: where it sits in the layers, which subsystem or package owns it, how others access it (Facade, Adapter + Factory, Proxy, Observer, Decorator, Strategy); what is bought and what is built; data and deployment choices. Invented, specific names such as FinanceFacade or IPaymentGateway are fine. | says "The system will be secure/usable" (that is the requirement, not a design), or offers a single class-level detail. |
| Motivation | Why the solution satisfies the factors: links to the priority hierarchy (legal, then business, then other), the principles (Low Coupling, High Cohesion, Protected Variations, separation of concerns), business goals (time-to-market, cost) and the evolution points supported; the trade-offs accepted. | says "Because it is good design." |
| Unresolved issues | Genuine open questions: legal details that need an SME, vendor selection, scale limits, edge cases, whether an interface will be sufficient. "None" is legal in Larman, but in the exam give at least one real question. | leaves the box blank or repeats the problem. |
| Alternatives | Two or more real alternatives, each with the reason it was rejected or deferred (cost, time, risk, coupling, reliability). | lists alternatives with no reasons. |
The course's worked memo (NextGen POS)
The course's example memo resolves the recovery factor from the factor table in §8.3. Before reading it, look at the design it describes: a Smart Proxy stands in for each remote service, so the rest of the POS never knows whether it is talking to the real remote service or a simplified local stand-in.
ITaxCalculatorAdapter, and the ServicesFactory decides what is behind it. The smart proxy delegates to the remote adapter when the service is up and to the simplified local one when it is not. (Class names other than ServicesFactory are illustrative.)Notice how the motivation does the real work: it ties the solution to a business goal (no lost sales, a selling point), explains each limit (small cache, no local tax calculator) by a cost, and names the evolution point it keeps open. Larman's two other memos show how short a good memo can be.
Check yourselfWhich two parts of a memo does Larman call the most valuable, and why?
The motivation and the rejected alternatives. A future architect who wants to change the system needs to know why this approach was chosen and why the others were turned down, so they can reconsider the alternatives intelligently instead of repeating a rejected idea.
Check yourselfSpot the problems in this exam memo. Factors: "The system must be secure." Solution: "We will make the system secure using best practice." Motivation: "Security is important." Unresolved: (blank). Alternatives: "Use a different approach."
Every box is weak. Factors restates the requirement: no sentence number, FURPS+ category, related factors, quality scenario or priority. Solution restates the requirement instead of naming mechanisms (layers, a Security subsystem behind a SecurityFacade, encryption in Persistence, a bought identity provider behind an adapter). Motivation gives no link to the priority hierarchy, principles or trade-offs. Unresolved is blank; give at least one real open question. Alternatives names no real alternative and gives no reason for rejection.
- A technical memo records one architectural decision. Textbook: Issue, Solution Summary, Factors, Solution, Motivation, Unresolved Issues, Alternatives Considered. Exam: the last five (Alternatives renamed Alternative Solutions), with the Issue as the first line of Factors.
- Good boxes are specific: mechanisms and layers in Solution; priorities, principles and trade-offs in Motivation; real open questions; each alternative with its rejection reason.
Logical Architecture and Layers
A system with hundreds of classes needs a large-scale shape, or every class ends up depending on every other and a change anywhere ripples everywhere. The logical architecture gives it that shape by grouping classes into packages, subsystems and layers, and the most common shape by far is the Layers pattern.
The logical architecture is the large-scale organisation of the software classes into packages (namespaces), subsystems and layers. It is logical because it ignores networking, physical computers and OS processes, which belong to the deployment architecture. It defines the packages in which the software classes live, and its main input is the non-functional requirements and constraints in the Supplementary Specification.
A layer is a very coarse-grained grouping of classes, packages or subsystems that has cohesive responsibility for a major aspect of the system. Higher layers (such as the UI) call on the services of lower layers, and not normally the reverse.
A logical architecture does not have to be layered, but layering is by far the most common choice. Larman calls it the Layers pattern (also known as Layered Architecture).
The common layers of an information system
Larman's Figure 13.4 (lecture slide 25) lists the layers commonly found in an information system, from the most application-specific at the top to the most general at the bottom. Each goes by several names, and you should recognise them all.
Strict versus relaxed layering
Layered architectures come in two kinds, depending on how far down a layer may call. Know which one information systems use; the exam likes this distinction.
Guidelines for designing with layers exam
- Organise the large-scale structure into distinct, cohesive layers, running from application-specific at the top to general, low-level services at the bottom.
- Keep a separation of concerns. UI objects do only UI work: windows, widgets and capturing events. Domain objects do only application logic, such as calculating totals and taxes or moving a game piece. So there is no application logic in UI objects, and domain objects don't trap mouse or keyboard events.
- Collaboration and coupling go from higher to lower layers. Avoid coupling from lower layers to higher ones; where upward communication is unavoidable, use Observer (§8.7).
- Don't show external resources as the bottom layer (Larman Fig. 13.7). See the pair of diagrams below.
- Name domain-layer classes after the domain model (see "Domain layer versus domain model" below).
Problems that layers solve, and their benefits exam
Each benefit of layering is the cure for a specific problem, so learn them as pairs.
| Problem without layers | How layering helps |
|---|---|
| Source-code changes ripple through the system because of high coupling. | Separation of concerns lowers coupling and raises cohesion; related complexity is encapsulated and decomposable. |
| Application logic is intertwined with the UI, so it can't be reused with another interface or distributed to another node. | Some layers can be replaced (UI, Application, Domain, though rarely Foundation), and some, mainly Domain and Technical Services, can be distributed. |
| General technical services or business logic are intertwined with application-specific logic, so they can't be reused, distributed or replaced. | Lower layers hold reusable functions; reuse potential and clarity increase. |
| High coupling across areas of concern makes it hard to divide work among developers. | Team development is easier: each team owns a layer or partition. |
Contraindications. Layers are not free. Extra layers of indirection can hurt performance, for example in a graphics-intensive game. And layers are not universal: Pipes and Filters suits processing through a changeable series of transformations, such as image processing, although even then the individual filters can be built with layers.
Other layer issues
- Is the Application layer optional? Yes. NextGen iteration 2 has none; instead
Register(the GRASP Controller) plays the role. Add one when there are multiple UIs (Application objects then act as Adapters and Facades for each UI), when the system is distributed with the Domain on a server shared by many clients so that session state must be kept, when the Domain layer cannot or should not keep session state, or when there is a controlled workflow of windows or pages. - Fuzzy membership. Is something Technical Services or Foundation? Domain or Business Infrastructure? Don't agonise over it: the lower two can be lumped together as "Infrastructure".
- What crosses layers? In a single-process desktop application, domain objects (Sale, Payment) can be visible to the UI and passed to Persistence. In a distributed system, the UI usually receives serializable copies of domain objects, known as data holder or value objects.
- Is coupling to Technical Services and Foundation dangerous? No, because they are stable. Coupling only hurts when it targets unstable variation or evolution points.
Layers versus partitions versus tiers exam
These three words are easily confused, and "tier" is genuinely ambiguous. The picture separates them.
The classic three-tier architecture dates from the 1970s and was popularised in the 1990s. Its tiers are Interface → Application Logic → Storage. The key point is a distinct middle tier of application logic, so that windows forward requests instead of doing the processing themselves. It was intended logically, so the three tiers could run on 2 nodes or on 3. A two-tier design, by contrast, puts the application logic inside window definitions that read and write the database directly, in the style of Visual Basic and PowerBuilder.
Finally, keep the logical and deployment views apart. Layers are a logical view: all of them might run in one process on one device (a PDA application) or be spread across many servers (a large web application). It is the deployment model (§8.9) that maps them to nodes.
MVC and layers
MVC began as a small-scale Smalltalk-80 pattern, in which models are data objects, views are widgets and controllers are event handlers. At the architectural level the term maps onto layers, as shown.
Domain layer versus domain model: a lower representational gap exam
Domain objects are software objects that represent things in the problem domain and hold the related application logic, such as a software Sale that can calculate its total. Because the application-logic layer is built from such objects, it is more accurately called the domain layer. The alternative, one big class holding all the logic, works, but it is a maintenance nightmare and isn't object-oriented thinking.
Keep two similar-sounding terms apart. The domain model (analysis, conceptual perspective; see Part II) is a picture of noteworthy real-world concepts. The domain layer (design, software perspective) consists of software classes. They are not the same thing; what links them is inspiration.
Payment with amount inspires a software Payment with amount: Money and getBalance(): Money. That small gap between how stakeholders think about the domain and how the software represents it is what Larman calls one of the big ideas of object technology.Check yourselfTrue or false: "In an information system, the UI layer should only ever call the layer directly beneath it."
False. That describes strict layering, which is common in protocol stacks such as OSI. Information systems normally use relaxed layering, in which a higher layer may call several lower layers, for example the UI calling both the Domain and Technical Services (for logging).
Check yourselfA new system will have a desktop UI and a web UI, and the domain logic will run on a shared server. Should it have an Application layer? Why?
Yes. Both conditions Larman gives apply. With multiple UIs, Application objects act as Adapters and Facades for each UI. With a distributed Domain shared by many clients, something must keep per-client session state, which is the Application layer's job (for example session facades).
Check yourself"Our system is three-tier, so it needs three servers." What is the mistake?
The classic three-tier architecture (Interface, Application Logic, Storage) was intended logically. It can be deployed on two nodes (a thicker client) or three (a thinner client). The word "tier" is ambiguous, which is why Larman prefers "layer" for the logical idea and leaves nodes to the deployment model.
Check yourselfWhat is the difference between the domain model and the domain layer, and what links them?
The domain model is an analysis artefact: a conceptual picture of real-world concepts, with no methods. The domain layer is part of the design: software classes holding application logic. The domain model inspires the names and definitions of the domain-layer classes, giving a lower representational gap.
- The logical architecture organises classes into packages, subsystems and layers. Common layers: UI, Application, Domain, Business Infrastructure, Technical Services, Foundation; coupling points down. Relaxed layering is the norm for information systems.
- Keep databases out of the layer stack: model the data need as a Domain sub-domain plus a Persistence partition. Layers are vertical, partitions horizontal, tiers usually physical; three-tier is logical.
- The domain model (concepts) inspires the domain layer (software classes): a lower representational gap.
Model-View Separation and Connecting the Layers exam
Layering says the UI sits above the domain, but it does not say how the two may talk. Two questions need answers: what visibility should other packages have to the UI layer, and how should non-window classes communicate with windows? The Model-View Separation principle answers them, and three patterns you already know (Controller, Facade and Observer) do the actual connecting.
The principle
- Do not connect or couple non-UI objects directly to UI objects. For example, a
Salemust not hold a reference to a SwingJFrame, or ask a window to display, recolour or close. Windows belong to one particular application, whereas domain objects should be reusable and attachable to a new UI. - Do not put application logic in UI object methods. UI objects should only initialise UI elements, receive UI events, and delegate application-logic requests to non-UI (domain) objects. A JFrame or JSP must not calculate tax.
Here "model" is an old term for the domain-layer objects, and "view" means UI objects such as windows, web pages and reports.
Sale cannot be reused with any other UI. (2) The window calculates tax, so that logic cannot be reused or tested without the window.Sale knows only the PropertyListener interface, never the window. Every arrow, including the realisation, points down.Why bother? Following the principle keeps the models cohesive and focused on domain processes, and lets the UI and the model be developed separately. Changes to UI requirements then have minimal impact on the domain. New views can be attached easily, and several simultaneous views of one model are possible, such as a table and a chart. The model can run without any UI at all, for batch or message processing, and it is easy to port to another UI framework.
The legitimate relaxation: Observer
Sometimes the domain really must tell the UI something, for example that the sale total has changed. The principle allows this, but only through an interface such as PropertyListener. The domain object doesn't know the receiver is a window; it only knows the receiver implements the interface. This is the Observer pattern from Part VI, used architecturally.
ProcessSaleFrame is in the UI layer; Sale and PropertyListener are domain-side or shared. The window registers itself with addPropertyListener(this), and Sale calls publishPropertyEvent whenever its total changes.In Java, the UI class is deliberately thin: it handles events and delegates, and the only thing it does with an event from the domain is display it.
// UI layer: thin. It handles events and delegates; it contains no application logic.
public class ProcessSaleFrame extends JFrame implements PropertyListener {
private final Register register; // domain-layer controller (GRASP Controller)
private void onEnterItemClicked(ItemID id, int qty) {
register.enterItem(id, qty); // the SSD system operation, delegated downward
}
public void onPropertyEvent(Object source, String name, Object value) {
if (name.equals("sale.total")) totalField.setText(value.toString()); // display only
}
}
Both directions in one interaction
Step through one enterItem to see the whole round trip: calls travel down from UI to controller to domain, and the update travels back up through the listener interface.
- The cast. One UI object,
:ProcessSaleFrame, and two domain objects::Register(the GRASP Controller) and:Sale. Earlier, the frame registered itself with the sale by callingaddPropertyListener(this). - The cashier clicks Enter Item. The UI object receives the UI event. That is all it is allowed to do with it, apart from delegating.
- The frame delegates
enterItem(id, qty)to the Register. This message crosses from the UI layer into the domain layer, and it is exactly the system operation you drew on the SSD. - The controller delegates the real work to the domain:
makeLineItem(desc, qty)on the Sale. The controller itself does no business logic. - The total has changed, so the Sale publishes an event. The message goes up to the frame, but the Sale is calling a
PropertyListener, not a window: it has no idea what kind of object is listening. - The frame displays the new total with
totalField.setText(…). Display only: no calculation happens in the UI. - Both directions. Downward messages are direct calls through the controller; the single upward message (highlighted) goes through an interface. That is Model-View Separation in action.
Connecting the layers: SSDs, Controller, Facade, Observer
The two architectural design decisions are "What are the big parts?" and "How are they connected?" The Layers pattern answers the first; GRASP and GoF patterns answer the second.
The first link is with the SSDs you already know from Part II: SSD system operations are the calls from the UI layer into the Application or Domain layer. The SSD hides the UI objects, but in reality a UI object such as ProcessSaleFrame captures the actor's input and forwards makeNewSale(), enterItem(id, qty) and endSale() to a domain object such as Register.
The object that receives these system operations is the Controller (GRASP), the first object beyond the UI. It can be a facade controller such as Register, which represents the whole system, or a use-case or session controller such as ProcessSaleSessionFacade in an Application layer. Once there are many use cases, or the system is distributed, session facades keep per-client session state.
For downward access to a subsystem, the usual pattern is Facade (GoF). Clients talk to one public facade, such as PersistenceFacade or POSRuleEngineFacade, and never to the subsystem's internals. A facade should expose a few coarse-grained, high-level operations, for example isInvalid(lineItem, sale) rather than many low-level Jess calls, for two reasons: many fine-grained operations make the facade incohesive, and fine-grained calls perform badly when they are remote. The facade itself does little work; it mediates. A small application may expose just a single object from the Domain layer, but the Technical Services layer exposes at least one facade per subsystem.
For upward communication, the usual pattern is Observer (GoF), as above. The alternative is a UIFacade inside the UI layer that receives requests from below; it adds Indirection, which gives Protected Variations if the GUI changes. Use a push-from-below model when polling would be inefficient, as in monitoring or simulation displays; otherwise the usual pull-from-above (polling) model is fine.
isInvalid(lineItem, sale), Larman's example of a coarse-grained facade operation.)A package may just group things; Pricing, for example, holds a factory and strategies. A subsystem is a discrete engine with behaviour and interfaces, such as Persistence, POSRuleEngine or Jess, and you mark it «subsystem».
Course example: Tony's Pizza
In the Week 4 case study, all the classes designed so far (Order, OrderLineItem, Pizza, Customer…) live in the domain layer, and a GUI layer sits on top with pages such as Choose Pizza, Cart and Checkout. Compare the two designs.
OrderHandler, a use-case-style controller. It acts like a "postbox": it delegates and does no business logic itself, although it may remember the currentOrder.Why a use-case controller rather than one facade controller for the whole system? Because a single controller for all use cases (deliveries, ingredient orders and so on) would become bloated. OrderHandler handles only ordering.
Check yourselfA Sale class has a method that calls mainWindow.showError("Out of stock"). Which part of Model-View Separation does this break, and how would you fix it?
Part 1: a non-UI object is coupled directly to a UI object, so Sale cannot be reused with another UI or run without one. Fix: have Sale publish an event (or throw an exception, or return a result) to a listener interface; the window implements the interface and decides how to display it (Observer). Alternatively the controller returns the problem to the UI that called it.
Check yourselfWhy should a facade to a remote rule engine offer isInvalid(lineItem, sale) instead of exposing the engine's individual low-level calls?
Two reasons from Larman: many fine-grained operations make the facade incohesive, and fine-grained calls perform badly when they are remote (one network round trip per call). A few coarse-grained, high-level operations keep the facade cohesive and the traffic low; the facade just mediates.
Check yourselfWhere do the messages on a system sequence diagram appear in the layered design?
They are the calls from the UI layer into the Application or Domain layer, received by the Controller (e.g. Register or a session facade). The SSD hides the UI object that captured the input and forwarded the message.
- Model-View Separation: no direct coupling from non-UI objects to UI objects, and no application logic in the UI. The domain may talk upward only through an interface (Observer).
- Downward: SSD system operations go from the UI to a Controller; subsystems are reached through a Facade with a few coarse-grained operations. Upward: Observer (or a UIFacade).
UML Package Diagrams and Package Design exam
To draw a logical architecture you need a notation for "this group of classes" and "this group depends on that one". UML package diagrams provide exactly that, and a layer is simply modelled as a package, for example a package named UI. A UML package can group anything (classes, other packages, use cases); it is more general than a Java package, and it defines a namespace, so two Date classes can live in different packages.
The full notation
The most common logical-architecture diagram shows roughly 5 to 20 packages and their dependencies. Show only a few noteworthy types inside them, because an architectural view deliberately hides the rest.
Drawing a logical architecture, step by step
The study guide gives a six-step procedure. The stepper applies it to NextGen, ending with a version of Larman's Figure 13.2.
- Start with a blank page and the six-step procedure.
- Step 1: draw the layers as large packages, top to bottom: UI, (Application), Domain, (Business Infrastructure), Technical Services, (Foundation). NextGen keeps the three essential ones.
- Step 2: add partition packages inside each layer. Partition the UI by technology (Swing, Web), the Domain by sub-domain (Sales, Payments, Taxes), and Technical Services by service (Persistence, Logging, RulesEngine).
- Step 3: optionally show a few key types: here the window, the controller
Registerand the adapter interfaceITaxCalculatorAdapter. Note that the Swing package holds our GUI classes built on Swing, not the Swing library itself. - Step 4: add dashed dependency arrows pointing downward only. Relaxed skips are allowed, such as the UI using Logging directly, but avoid cycles.
- Step 5: mark the real subsystems «subsystem», each with its facade: Persistence behind
PersistenceFacade, the rules engine behindPOSRuleEngineFacade. - Step 6: keep databases and servers out. The need for data is already modelled as Domain sub-domains plus the Persistence partition; the physical database belongs in a deployment or component diagram.
Mapping layers and packages to Java
Larman (§13.6) suggests putting the layer name in the package path, and leaving the application qualifier (nextgen) out of reusable packages so that they can be shared across projects. A UML tool can then reverse-engineer the layered package diagram straight from the code.
// UI layer
com.mycompany.nextgen.ui.swing
com.mycompany.nextgen.ui.web
// Domain layer (NextGen-specific)
com.mycompany.nextgen.domain.sales
com.mycompany.nextgen.domain.payments
// Technical Services layer
com.mycompany.service.persistence // home-grown, reusable across projects
org.apache.log4j // third party
org.apache.soap.rpc
// Foundation layer
com.mycompany.util
Check yourselfSpot the errors: a student draws the Domain package with a solid arrow pointing up to UI, and puts an "Oracle DB" package under Technical Services as a fourth layer.
Three errors. (1) Dependencies are dashed lines with an open arrowhead, not solid. (2) The arrow points to the depended-on package, and coupling should go down: UI depends on Domain, so the arrow goes from UI down to Domain. An upward dependency breaks the layering (use Observer if the domain must notify the UI). (3) A database is a physical resource; drawing it as a layer mixes the logical and deployment views. Model the data need as a Domain sub-domain plus a Persistence partition instead.
Package design guidelines (Larman ch. 35, brief)
Once you have packages, how should you decide what goes in each? Larman gives a short set of guidelines.
- Package functionally cohesive vertical and horizontal slices. Group together the types that work together. A clue is strong coupling inside the package and weak coupling outside it. One measure is relational cohesion = internal relations ÷ number of types; the higher it is, the more cohesive the package.
- Package a family of interfaces separately from their implementations, as in
javax.ejb. - Package by work and by clusters of unstable classes. Split out the subset that changes frequently, so that fewer developers depend on it.
- The most responsible (depended-on) packages must be the most stable. To make a package more stable, have it contain mostly interfaces or abstract classes, give it few dependencies or only stable ones, hide its implementation behind a facade, test it well, and mandate that it change slowly.
- Factor out independent types into their own package. For example, the JDBC utilities move out of Persistence into
util.jdbc. - Use factories to reduce dependency on concrete packages. The factories return interfaces; this is the Domain Object Factory idiom.
- No cycles between packages. There are two ways to break a cycle, shown below.
Check yourselfPackage P has 5 types with 10 relations among them; package Q has 5 types with 3. Which is more cohesive by Larman's measure, and what would you consider doing with Q?
Relational cohesion = internal relations ÷ types: P = 10 ÷ 5 = 2.0, Q = 3 ÷ 5 = 0.6. P is more cohesive. Q's types barely work together, which hints that it groups unrelated things: consider re-packaging them with the types they actually collaborate with, or factoring out the independent ones.
- Package = tabbed folder (name on the tab if contents shown). Nesting: embedded,
A::B, or circle-cross at the owner. Dependency = dashed open arrow to the depended-on package. «subsystem» marks real engines. - Procedure: layers, partitions, a few key types, downward dependencies (relaxed skips OK, no cycles), subsystems with facades, no databases.
- Package design: cohesive slices, interfaces apart, unstable classes apart, most depended-on = most stable, factories, and no cycles.
Component and Deployment Diagrams, and the SAD
Package diagrams show how the code is organised. Two more views complete the picture: component diagrams show the large replaceable building blocks and the interfaces between them (the lecture's "implementation view"), and deployment diagrams show where the software physically runs. The Software Architecture Document then gathers all the views in one place.
In the Week 12 review lecture's Q&A, component diagrams were said to be unlikely to be examined, though still useful background for software architecture. Learn the notation well enough to read and sketch one, but spend your revision time on Q6-style analysis and technical memos first.
Components
A modular part of a system that encapsulates its contents and is replaceable within its environment. A component defines its behaviour through provided and required interfaces.
A component can be a class, so the difference is mostly intent. Calling something a component says two things: (1) its interfaces are important, and (2) it is modular, self-contained and replaceable, like a home-entertainment unit you can swap. External resources and services, such as a SQL database or a JMS messaging service, are components too. Use components for large-grained elements; a component diagram gives the initial high-level landscape of how the system will be implemented.
Workshop 10: from block diagram to component diagram
- Start with an informal block diagram: named boxes joined by lines, with no formal notation.
- Formalise it as a component diagram with ball-and-socket interfaces.
- The hotel-booking example below shows the result.
- Notice that this is still a layered structure: UI, then Services, then Domain.
Workshop 10 POS exercise (Mobile Service Terminal)
The official partial solution gives no diagrams. It explains why the worksheet has two exercises: Exercise 1 is for understanding the drivers of the architecture, generating alternative options and weighing their pros and cons without worrying about UML details; Exercise 2 is for understanding component-diagram notation and applying it. The rest is a "General Comment" in four points.
- External elements should already have been identified, such as the credit check agency and the security subsystem, and the architecture needs an external interface to each of them.
- The logical elements should be assigned to the layers of a layered architecture, also considering the horizontal partitions within each layer, without being influenced by where the elements will be deployed (the logical-versus-deployment distinction of §8.1).
- The architectural factors worth considering, with how critical each is: supporting multiple MSTs; credit checks (reliability and security); the security release of purchased items (reliability and security); logging of sales (data security and integrity); updating the inventory (data security and integrity).
- The deployment architecture must support multiple MSTs, with options from a thin client, through a thick client, to fully distributed peers; what are the pros and cons? On control: every activity starts at an MST, but control need not stay there. With a thin client control is on a server; with a thicker client you can choose how to assign it.
A sketch that fits these points (the study guide's own, not official):
- Architecturally significant FRs: card validation and charging through the external credit agency; releasing sold items to the external security system (barcodes); automatic inventory updates on sales and stock arrivals; supervisor queries.
- NFRs: the dominant one is reliability: card sales must succeed with 99.9999% probability (rule 7). The official solution adds security (credit checks, release of items) and data security and integrity (sales log, inventory). Supporting many wireless terminals at once (mobility) is a factor too, and the guide would add the performance of price lookups.
- Natural decomposition: the MST client (UI plus a sale controller); a Sales/Payment service with a
CreditAgencyAdapterplus store-card accounts that use a discount Strategy; an Inventory service; aSecuritySystemAdapterthat releases items; and a Transaction log for accounting and analysis. Following point 2, place them in layers before deciding where they run: the MST UI in the UI layer; the sale controller and the sales, payment and inventory logic in the application and domain layers; the two adapters and the transaction log in technical services. - Control is event-driven from the MST UI. With a thin client, server-side services hold control and wait for requests; with a thicker client, you decide how much control stays on the MST. Messages cross the physical boundaries (MST to server, server to credit agency and security system), while method calls are used within a node. The reliability requirement motivates redundancy, retries and store-and-forward.
Weighing the options. A thin client keeps the MST simple and puts the sale logic, sales log and inventory in one place, which helps security and data integrity and makes updates easy. But every sale then needs both the wireless network and the server, which become single points of failure for the 99.9999% target unless the server side is replicated. A thick client keeps working through short network drops, responds faster and can store and forward its sale records, but the logic and sensitive data now sit on many devices that all have to be secured and updated, and the inventory and logs can briefly disagree. Fully distributed peers remove the central server altogether, but duplicating the sales log on every MST, or electing one MST to hold it, makes integrity, security and consistency much harder to guarantee. The Chauffeured Cars case study (§8.11) shows the same trade-off in real life.
Deployment diagrams
A deployment diagram (Larman §38.1, only lightly covered) shows artifacts, such as .jar, .war or .exe files, deployed on nodes. There are two kinds of node: a device node is hardware, such as a PC or a phone; an execution environment node is software that hosts other software, such as an OS, a JVM, a database engine, a browser or a servlet container. Nodes are joined by communication paths labelled with the protocol (HTTP, SOAP, SQL). This is the physical view, so never mix it into a logical layer diagram.
«device» for hardware, «executionEnvironment» for hosting software, nested inside the device that runs it. Artifacts (files) sit inside the node they are deployed on. Lines between nodes are communication paths labelled with their protocol. (The system shown is an invented example of the notation; the course's own worked deployment diagrams are in the Chauffeured Cars case, §8.11.)Check yourselfIn a component diagram, component A has a half-circle on a stick, and component B has a full circle on a stick sitting inside it. Which component needs the interface, and what is the combined symbol called?
A needs it: the half-circle (socket) is a required interface. B provides it (the ball). A ball sitting in a socket is an assembly connector: A's requirement is satisfied by B's provision.
Check yourselfA JVM and a laptop both appear in a deployment diagram. Which kind of node is each?
The laptop is a device node (hardware). The JVM is an execution environment node (software that hosts other software), drawn nested inside the laptop. Artifacts such as a .jar are deployed inside the JVM.
Documenting architecture: the SAD and the N+1 views
This has low exam priority. The Week 10 lecture doesn't cover it, but the Week 11 and 12 lectures name the SAD as an elaboration artefact (holding, for example, a component diagram, the factor table and the technical memos), so know what it is.
- A component is a modular, replaceable part defined by provided (ball) and required (socket) interfaces; ball-in-socket is an assembly connector; ports and delegation connectors link outer to inner parts. Unlikely to be examined.
- A deployment diagram puts artifacts on device and execution-environment nodes joined by protocol-labelled paths: the physical view.
- The SAD holds the representation, factors (by reference), decisions (memos) and the N+1 views, each with a motivation.
Past Exam Q6: Full Model Answers and a Template exam
Everything in this Part comes together in Q6. This section works both 2021 papers in full, sets the study guide's model answers beside the official answers released on 26/27 October, and ends with a fill-in template you can use under time pressure.
2021 S1: Sportsy (Australian sports-club app)
S1 The app targets Australian sports clubs.
S2 Its users are members, including volunteers and officials.
S3 It handles (a) memberships and fees, (b) events, (c) member communication,
(d) club purchases, and (e) payments for events and merchandise.
S4 There is a legal requirement to keep a detailed record of all financial
transactions, incoming and outgoing.
S5 The app must be easily usable by a diverse group of users.
S6 There must be a short development time because of a competitor.
Q6.1 model answer
Architecturally significant functional requirement: financial transaction record-keeping (S4, with S3a, S3d, S3e). Every fee, purchase and payment, incoming or outgoing, must be captured in a detailed, permanent record. This is a functional capability, an auditing / audit-trail function, driven by a legal constraint.
Architecturally significant non-functional requirement: usability for a diverse group of users (S5) (FURPS+ Usability). Members, volunteers and officials (S2) of different ages, abilities and technical skill, using different devices, must all be able to use the app easily.
Architectural analysis. Architectural analysis is the activity of identifying the factors that will influence the architecture, understanding their variability and priority, and resolving them; in other words, resolving the non-functional requirements in the context of the functional ones. It happens early (inception and early elaboration) and iteratively.
- Step 1: identify and analyse the factors. Read the description using FURPS+ as a checklist. For Sportsy this finds S4, legal record-keeping; S5, usability; S6, time-to-market, a schedule constraint that favours buying or reusing components; S3e, payments, which need an interface to an external payment provider plus security; and S3c, communication through email or push services. Record each factor in a factor table with its quality scenario (e.g. "an auditor reconciling any month finds 100% of transactions recorded"); its variability, both current flexibility (the record format is flexible) and evolution (clubs will want export to accounting software); its impact on stakeholders (the treasurer is legally liable), the architecture and other factors; its priority (H, because it is legal); and its difficulty/risk.
- Step 2: resolve the factors. For the high-priority factors, analyse the alternatives (build or buy, remove the requirement, hire an expert) and make architectural decisions, prioritised with inflexible constraints first (S4, legal), then business goals (S6, beating the competitor), then other goals. Record the decisions in technical memos setting out the factors, solution, motivation, unresolved issues and alternatives.
Why it is important.
- It reduces the risk of missing a critical factor. If S4 were discovered late, record-keeping would have to be retrofitted into every payment path, risking legal non-compliance.
- It focuses effort on high-priority issues. With S6's short schedule, effort must go to the records and payments, not to gold-plating.
- It aligns the product with business goals: getting to market before the competitor (S6) and suiting diverse clubs.
Why the two requirements are architecturally significant. Record-keeping (S4):
- It is cross-cutting: it touches every money-handling feature (S3a, S3d, S3e), so it needs a system-wide mechanism rather than code in each feature.
- It is legal, and therefore inflexible, which makes it top priority.
- It drives persistence and reliability decisions (records are append-only, and a payment must never succeed without its record), as well as security decisions.
- It is costly to retrofit.
- It has variability: retention and reporting rules can change, and export to accounting software is an evolution point.
Usability (S5):
- Diverse users imply several clients (a mobile app at the ground, the web for treasurers), accessibility and possibly localisation. That requires Model-View Separation and an Application/controller layer, so that several UIs share one domain layer. It also requires a large-scale choice of a cross-platform UI framework and a shared UI component library for consistency.
- It trades off against security (simple logins versus strong authentication for officials) and against the schedule (S6).
- It must be made measurable, for example "90% of first-time volunteers can pay for an event on a phone within 3 minutes without help".
Q6.2 model answer: a technical memo for the functional ASR
First the design the memo describes, then the memo itself.
FinanceFacade; no other package may write financial data. The ledger is append-only, and payment providers sit behind adapters made by a factory. All names are invented, which the exam allows.- S4: a detailed record of all incoming and outgoing financial transactions, required by law. An inflexible constraint, priority H, difficulty M.
- The transactions arise from S3a (membership fees), S3d (club purchases) and S3e (event and merchandise payments).
- Related factors: reliability (no money moves without a record), the security and integrity of financial data, and S6's short time-to-market.
- Quality scenario: when an auditor reconciles any period against bank and payment-provider statements, 100% of transactions appear with amount, date/time, payer/payee, purpose, method and provider reference, and no record has been altered or deleted.
- Summary: one Finance subsystem with an append-only ledger. All money flows go through its facade, and payment providers sit behind adapters.
- The layered logical architecture has four layers: UI (mobile app, web); Application, with the use-case controllers
MembershipController,EventControllerandShopController; Domain, with Memberships, Events, Shop and «subsystem» Finance; and Technical Services (Persistence,PaymentGatewayadapters, Logging). FinanceFacade(Facade) is the only entry point for anything involving money, with coarse-grained operationstakePayment(...),recordIncoming(...),recordOutgoing(...)andgetStatement(period). No other package may write financial data, and the package dependencies enforce this.- The ledger holds immutable
LedgerEntryobjects. Corrections are new reversing entries, never edits or deletes. The business change (a ticket sale, say) and its ledger entry are written in one database transaction through thePersistenceFacade, so either both are saved or neither is. - For external payment providers, an
IPaymentGatewayinterface has one Adapter per provider (e.g. a card gateway, or PayPal), created by a ServicesFactory (Protected Variations). Each entry stores the provider's transaction id for reconciliation. - For reporting, statements and auditor exports go through an
ExportStrategy(CSV, accounting-package format).
- Legal compliance is an inflexible constraint, so it takes top priority. A single subsystem makes completeness checkable and testable, and gives one place to change when the rules change (High Cohesion, Low Coupling, Protected Variations).
- Separation of concerns. Recording is a cross-cutting concern, so it is modularised into its own component; the membership, event and shop classes keep only their own logic.
- Append-only, same-transaction writes give a tamper-evident, complete trail, and also satisfy the reliability factor.
- A hosted payment provider behind adapters means we don't build card handling ourselves, avoiding security and compliance risk and saving time (supporting S6). It also lets clubs switch provider, a variation and evolution point.
- Trade-off accepted. The extra subsystem and indirection cost some development time up front, but far less than retrofitting records later.
- Exact legal requirements: how many years must records be kept, and in what detail? This depends on the club's legal structure, so we need a legal or accounting SME.
- Cash and manual transactions entered by volunteers: how are they verified, and is a second approval needed?
- Is the lowest-common-denominator gateway interface enough for refunds and chargebacks?
- Check the performance of statement generation and archiving for large clubs.
- Each feature module records its own transactions. Rejected: records would be scattered and inconsistent, it would be easy to miss a path, and cohesion would be low.
- Rely on the payment provider's records. Rejected: they don't cover outgoing purchases (S3d), cash or multiple providers, and they would tie legal compliance to one vendor.
- Make an external accounting package the system of record. Deferred, because of the per-club licence cost, the setup effort and the dependence on an external service's availability. Kept as an evolution point through an
AccountingExportAdapter.
Other acceptable choices for Sportsy (if justified)
| Requirement | Class, and why significant | Memo sketch: Solution · Motivation · Alternative |
|---|---|---|
| S3e, take payments | FR (plus Interface and Security). External system, card security and reliability; used by S3a, S3d and S3e. | IPaymentGateway with Adapters and a Factory, and a Proxy with retry · Protected Variations; card security outsourced · in-house card processing, rejected for security and compliance risk. |
| S3c, member communication | FR (Mail, in the lecture list). Integration with email, SMS and push providers; scale of bulk messages. | A MessagingFacade over provider adapters, with an asynchronous queue · — · direct SMTP from each feature, rejected because of the coupling. |
| S6, short time-to-market | NFR (schedule constraint and business goal). Determines buy versus build across the whole system; a tight schedule favours buying. | Hosted payment and messaging services, a cloud backend, one cross-platform UI codebase, all behind adapters · beats the competitor; adapters keep vendors replaceable · a native app per platform and building everything, rejected because of the time. |
| S4 legal records, as an NFR | NFR (+Legal), significant for the same reasons as above. | Same memo, but say explicitly "FURPS+ +Legal". |
The official answer picks the same two requirements and classifies them the same way, confirming the model answer. For Q6.1 it names logging all financial transactions as the functional ASR, because such transactions happen in different parts of the app, and easy use by members (who may be volunteers or club officials), meaning ease of use and a consistent user interface, as the non-functional one. It describes architectural analysis as a specialisation of requirements analysis that identifies the factors that should influence the architecture, understands their variability and priority, and resolves them, done early so that the architecture is fit for purpose. It then gives the consequence of ignoring each: without financial logging, clubs would fail their legal obligations; without a consistent, usable interface, members would be unlikely to adopt the app; either would mean the project failed its business goals. That move, stating what failure would cost, is a compact way to answer "why significant" and is worth copying.
Its Q6.2 memo, on the logging requirement, is only five short points, which tells you the level of detail 10 marks need:
The guide's memo uses a different mechanism (a Finance facade over an append-only ledger written in the same database transaction), and it is equally valid: the marks reward a concrete solution traced back to the factor, not one particular design. The official one is a useful second example of naming a pattern (Observer) as part of an architectural solution.
2021 S2: Doctar (Australian GP clinic app)
S1 The app is for GP clinics across Australia.
S2 Its users are doctors, health professionals and admin staff.
S3 Its features are (a) add patients and their details, (b) pre-existing conditions,
(c) schedule consultations, (d) consultation notes (doctors only), and
(e) print prescriptions (doctors only).
S4 It is made available to different clinics, each configuring its own branding
and contact information.
S5 It must ensure patient confidentiality: store information securely, with
appropriate security measures.
The guide's first version called branding (S4) the functional requirement and security (S5) the non-functional one. The official answer does the opposite: it treats storing information securely with appropriate security measures as the functional ASR, because confidential information is used in many parts of the app, and configurability for branding and contact information as the non-functional one, because that information appears in many places in the UI. This matches FURPS+, which files Security under Functional and configurability under Supportability. The labels below follow the official classification; the reasons for each requirement are unchanged.
Q6.1 model answer
Architecturally significant functional requirement: security and confidentiality of patient information (S5). Patient data must be stored securely and protected against unauthorised access, including the doctors-only rules in S3d and S3e. FURPS+ files security under "Functional", and the official answer classifies it that way. (It also has a +Legal side because of privacy law, worth a mention.)
Architecturally significant non-functional requirement: per-clinic configuration of branding and contact information (S4). A clinic administrator configures the clinic's name, logo, colours and contact details, which then appear on every screen and on printed outputs such as prescriptions (S3e). This is a supportability (configurability) requirement, and it implies that the app is one product serving many clinics (multi-tenant).
Architectural analysis. Architectural analysis identifies the factors that will influence Doctar's architecture, understands their variability and priority, and resolves them; it resolves the NFRs in the context of the FRs. It starts in inception and is the focus of early elaboration.
- Step 1: identify and analyse the factors using FURPS+: S5, security and confidentiality (legal); S4, multi-clinic configurability; S3e, printing (printers in each clinic, and a regulated prescription format); S2's several user roles; and implicit availability, since a clinic can't see patients if the system is down. Record each in a factor table with a quality scenario (e.g. "100% of non-doctor requests for consultation notes are denied and logged"); its variability (currently a fixed set of roles; in future, new roles and stricter privacy rules); its impact on stakeholders (patients, doctors, clinic owners), the architecture and other factors (usability, performance); its priority (H); and its difficulty/risk (H).
- Step 2: resolve them. Analyse alternatives and make architectural decisions, prioritising inflexible constraints (S5 privacy and security) over business goals (selling to many clinics, S4). Record the decisions in technical memos.
Why it is important.
- It reduces the risk of missing a critical factor. Discovering S5 late would mean retrofitting security into every layer, possibly after a breach.
- It focuses effort on high-priority factors such as security, rather than on low-value polish.
- It aligns the product with the business goal of selling one product to many clinics nationwide (S1, S4).
Why the two requirements are architecturally significant. Branding and configuration (S4):
- It is system-wide, touching every UI view and every printed document.
- It forces a large-scale multi-tenancy decision: one shared deployment with per-clinic data and configuration, or a separate installation per clinic.
- It is a clear variation point (it differs per clinic) and an evolution point (clinics will later want custom forms or appointment rules).
- It is expensive to retrofit if names and logos are hard-coded (the Windows XP story), so it needs Protected Variations through data-driven configuration.
Security (S5):
- It is cross-cutting: authentication at the UI, authorisation for every operation, encryption in persistence, and audit logging.
- It is legal and ethical, so inflexible and top priority.
- It interacts with other factors: usability (staff are busy), performance (encryption), and S4 (clinic A must never see clinic B's patients).
- It means choosing third-party security products and hosting.
- It is very hard to add later.
Q6.2 model answer: a technical memo for the security ASR
SecurityFacade before delegating (gold path). The UIs hold no access logic, so no client can bypass the check; persistence encrypts and filters by clinic so no developer can forget.- S5: store patient information securely, with appropriate security measures. A legal and ethical inflexible constraint, priority H, difficulty H.
- Under S3d and S3e, only doctors may access consultation notes and print prescriptions: role-based access.
- Under S4, many clinics use the same product, so each clinic's data must be isolated.
- S2 introduces several user roles; for usability, security must not slow busy staff unduly.
- Quality scenarios: a user without the Doctor role requesting consultation notes through any client or API is denied, and the attempt is logged, 100% of the time (automated security tests every release); stolen database files or backups reveal no readable patient data; for any record, every access (who, when, which clinic) can be reported within one day of an audit request.
- Summary: a layered architecture with a central Security subsystem enforced at the Application layer, encryption in Persistence, per-clinic partitioning, and an audit log.
- Layers: UI (reception and doctor clients); Application, with use-case controllers such as
ConsultationControllerandPrescriptionController; Domain (Patients, Scheduling, Consultations, Prescriptions); Technical Services («subsystem» Security, Persistence, AuditLog, Printing); and Foundation. SecurityFacadeprovidesauthenticate(...)(with multi-factor authentication for doctors) andauthorise(user, operation, resource), using role-based access control (Doctor, HealthProfessional, Admin). Roles and permissions are kept in configuration (data-driven), not in code.- A single enforcement point. Every system operation enters through the Application-layer controllers (GRASP Controller), which call
SecurityFacadebefore delegating to the domain. The UIs contain no access logic and cannot bypass the check (Model-View Separation). The check can be applied as a Decorator/Proxy around the controllers, keeping domain classes free of security code (cross-cutting technique 2). - Persistence uses encryption at rest (database and backups) and TLS in transit. A clinic (tenant) id is attached to every record, and the
PersistenceFacadefilters on it inside every query, so callers can't forget. - The AuditLog service keeps an append-only record of every read and write of patient data.
- The security components are bought, not built: a proven identity provider and crypto library behind an
IIdentityProviderAdapter. Hosting is in an Australian data centre.
- Confidentiality is a legal and ethical inflexible constraint, so it is the highest priority. A breach means penalties, lost trust and the end of the product.
- Centralising security in one subsystem (separation of concerns, High Cohesion) gives one place to verify, test and update when rules change, and the domain classes stay cohesive.
- Enforcing security in the Application layer means any future client (a mobile app, for instance) automatically inherits the same rules, supporting the evolution point.
- Tenant filtering inside persistence removes the reliance on each developer remembering it; with encryption, it meets the S4 isolation requirement and the stolen-data scenario.
- Third-party identity and crypto are well tested, faster to adopt and less risky than home-grown security, and the adapter keeps the vendor replaceable (Protected Variations).
- Trade-offs accepted: some performance overhead from encryption and checks, and some login friction from multi-factor authentication, mitigated by session timeouts tuned to the clinic workflow (usability).
- Exact legal obligations: which privacy principles apply, retention periods for medical records, and whether data may be stored offshore. Needs a legal SME.
- Emergency "break-glass" access: may a nurse view notes in an emergency, and how is that audited?
- Key management: who holds and rotates each clinic's keys?
- How to search encrypted fields (such as patient name) without unacceptable performance.
- Security checks in each UI screen. Rejected: duplicated, easily bypassed through other clients, and a violation of Model-View Separation.
- A separate installation and database per clinic (physical isolation). Rejected for version 1 because of higher hosting cost and harder upgrades across hundreds of clinics; kept as an option for large clinics (an evolution point).
- Build our own authentication and encryption. Rejected as high-risk and slow.
- Rely on network security only (clinic firewall or VPN). Rejected: no protection for data at rest or against insider access.
Other acceptable choices for Doctar (if justified)
- S4 branding as the memo topic. Classify it as an FR, or as an NFR under Supportability—Configurability, and say which. Solution: a
ClinicProfileper tenant, and aBrandingServicein Technical Services that supplies the name, logo, colours and contacts to all UI themes and print templates, with no literal clinic data in the code (data-driven design, Protected Variations). Motivation: one codebase for all clinics, keeping maintenance low; remember the Windows XP lesson. Unresolved: how far customisation goes (custom fields? layouts?). Alternatives: a forked build per clinic, rejected because of the maintenance explosion; hard-coding and customising per sale, also rejected. - S3e print prescriptions. An FR (Printing, in the lecture list). Solution: a
PrintingServicefacade, a printer adapter for each clinic's printer or driver, and prescription templates with branding; later, an adapter to an electronic-prescription service. Alternatives: printing from each screen, rejected because of the duplication and coupling. - S3d/S3e role restrictions. An FR (Security, in the lecture list), handled by the same mechanism as the security memo. Don't pick it together with S5: that gives two overlapping requirements.
The official memo (released 26/27 Oct) is on the same requirement, storing and managing confidential information, and again gives one short point per heading:
The guide's memo covers all of this and goes further, putting role-based access control into the solution where the official answer leaves it as an unresolved issue. Both are valid; the official version is the minimum, and it shows again that naming a GoF pattern (here Façade) inside the solution is welcome. Its Q6.1 follows the Sportsy pattern: architectural analysis as a specialisation of requirements analysis, and the cost of failure for each requirement (failing legal obligations on confidentiality; clinics across Australia not adopting an app they cannot brand).
A reusable template for Q6 under time pressure
Before writing (1 minute). Underline every sentence with a FURPS+ flavour, then pick two requirements that don't overlap. The FR should be cross-cutting or external: auditing or records, payments, printing, messaging, configuration or branding, and security access rules are typical. The NFR should be cross-cutting and high priority: security, reliability or availability, usability across many users and devices, performance or scalability, or a schedule or cost constraint.
Both official answers follow FURPS+ strictly. Sportsy's transaction logging and Doctar's secure storage are the functional ASRs; Sportsy's usability and Doctar's branding configurability are the non-functional ones. So if you pick security, the safe label is functional (FURPS+ F); if you pick configurability, the safe label is non-functional (Supportability). Whichever way you go, name the FURPS+ category so the marker can see your reasoning.
Check yourselfPractice scenario (invented): "S1 A food-delivery app for one city. S2 Customers order from restaurants. S3 Drivers' locations are shown live on a map. S4 Payments go through the bank's card gateway. S5 The app must stay available during the dinner rush (6–8 pm)." Pick an FR and an NFR ASR, classify them, and give two WIDEST reasons for each.
FR ASR: S4, card payments (FURPS+ F, with +Interface). External: the bank's gateway is outside our control, so it needs an adapter and a failure plan. Inflexible: payment security and correctness are non-negotiable. NFR ASR: S5, availability at peak (FURPS+ Reliability, with Performance). Wide: every feature must stay up, so it drives deployment (redundant servers) and caching. Trade-offs: availability and performance against cost. S3 (live map) would also be defensible as the FR (external map service, performance).
Check yourselfA student picks S3d (doctors-only consultation notes) as the FR and S5 (security) as the NFR for Doctar. What is the problem?
The two overlap: S3d's role restriction is part of security, so the answer is really one requirement twice, and the marker cannot award two distinct justifications. Pick S5 (security, functional in FURPS+) with S4 (branding, Supportability) as the official answer does, or another non-overlapping pair such as S5 with S3e printing.
Check yourselfHow does the official Sportsy memo use a GoF pattern, and why is that a good move in Q6.2?
It uses Observer to decouple transaction execution from logging: the transaction code publishes events (intent, outcome) and the logging component listens, sending the log to a central cloud server. Naming a pattern turns "we will log things" into a concrete architectural mechanism with a known benefit (low coupling), which is exactly what the "reasoned architectural argument" criterion rewards.
- Q6.1: classify one FR and one NFR ASR (follow FURPS+: security is F, configurability is S), define AA with scenario examples for both steps, give the three reasons it matters, and justify each ASR with 3+ WIDEST reasons and the cost of failure.
- Q6.2: a memo on one of the two, five boxes, with concrete layers, subsystems and patterns, motivation tied to priorities and principles, real open questions, and reasons for every rejected alternative. The official answers are much shorter than the guide's, and both are valid.
Case Study: Chauffeured Cars (Week 11)
Textbook examples start from a clean slate; real architecture work usually starts from a struggling legacy system. The Week 11 lecture ends with such a case, a chauffeured car company, and walks through analysis, options and a staged migration. It is not among the Week 12 key topics, and the review's Q&A says specific tools such as Amazon Web Services are not the subject's focus, so learn the reasoning, not the technology. It illustrates analysis (§8.2), resolving factors (§8.4), weighing alternatives as a memo does (§8.5) and deployment diagrams (§8.9).
The client and its problems
The client runs about 30 drivers. Its Bookings and Dispatch (B&D) system is business critical: bookings arrive by phone and email, and between one and four operators use the system at the same time. Uber-style operators are also encroaching on the business with a different business model, so the company needs to highlight the differences to its customers.
From the client's own perspective there were five problems: the system was slow or hung, especially while a customer was on the phone; when it was unavailable, operators fell back on pen and paper; functionality was missing (invoicing and reporting, and a customer portal for online booking and profiles); the IT provider, "Developer A", was unhelpful; and keeping the status quo carried a significant cost overhead.
Analysis: from complaints to quality attributes
The investigation turned the complaints into quality attributes, which is architectural analysis in miniature, and then traced each one to an architectural cause.
The technical investigation found three more issues. Version 3's technology was dated, so the dependency on it had to go. The database ran on a recent SQL Server, but its schema (types, use of indexing, use of built-in validation) dated from Version 3, so it used none of the newer features for performance and reliability. And the design of both V3 and V5 was generally poor and, in particular, highly coupled.
Options and the decision
| Option | Pros | Cons |
|---|---|---|
| 1. Use a commercial off-the-shelf (COTS) product | Up and running quickly; low starting cost | Doesn't fit how this business differs; no control of the software |
| 2. Rebuild a whole new system | Built for the client's current needs and business | High cost; a long delay before it is available |
| 3. Modify the existing system chosen | Easier business transition; control of the software | Needs a willing developer; uncertain cost and delay |
The client chose option 3, once a willing developer had been identified, under the banner "Take Control". This is the buy-versus-build kind of decision from §8.1, and the rejected options are exactly what a technical memo records under Alternatives considered.
A staged migration, drawn
The plan ran in four stages, each fixing some issues and leaving others for later. Step through the deployment diagrams. Each 3-D box is a node: «device» nodes for the operators' PCs, with «executionEnvironment» nodes (login sessions, virtual machines, Amazon Web Services) nested inside; component instances such as :B&D System V5 sit inside them.
- Where it started. Each operator's PC ran only a Remote Desktop client, connected over the internet to a virtual machine on Developer A's server. There each operator had a login session running both V3 and V5, and both used one SQL Server database. Every keystroke crossed the internet, so the UI froze; when the connection dropped, there was no system at all.
- Stage 1. The V3-only functions were added to V5, and the local PCs were set up to run V5 as a thick client talking directly to the database, which stayed on Developer A's server. Benefits: no more Visual Basic; one application instead of two (less coupling, better maintainability); running locally removed the lag. The lecture counts the slow system, the pen-and-paper fall-back and the missing invoicing and reporting as addressed here. Still open: the database server still belonged to the unhelpful Developer A.
- Stage 2. The SQL Server database was migrated from Developer A's server to Amazon Web Services. Benefits: no further dependence on Developer A; better reliability; easy options for more backend performance and for redundancy; lower maintenance cost. Still open: the customer portal (online booking, profile).
- Stage 3. A new Pricing Service component, on a virtual machine in AWS, replaced the pricing inside V5, and a new Web Site made prices available to customers. Benefits: the start of a service-based architecture; one shared location for services; more transparency for customers; opportunities for server optimisation. Still open: online booking. (The V5 clients connect to the services and the database over the same internet path.)
- Stage 4. A new Booking Service replaced the booking inside V5, a Booking Portal on the web site let customers book, and the database was partitioned to separate the bookings from the old V3 data ("V3 Balance"). Benefits: customers can make their own bookings, which was critical; the service-based architecture grows; migration away from the V3 schema and configuration begins.
| Stage | What changed | Benefits | Still open afterwards |
|---|---|---|---|
| 1 | V3-only functions added to V5; PCs run V5 as a thick client talking directly to the database, which stays on Developer A's server | No more Visual Basic; one application instead of two (less coupling, better maintainability); no client lag. Addresses the slow system, pen and paper, and missing invoicing/reporting | The database server still belongs to Developer A |
| 2 | SQL Server database migrated to Amazon Web Services | No dependence on Developer A; better reliability; easy backend performance and redundancy options; lower maintenance cost | The customer portal (online booking, profile) |
| 3 | New Pricing Service (VM in AWS) replaces pricing in V5; new Web Site shows prices to customers | Start of a service-based architecture; one shared location for services; transparency for customers; server optimisation | Online booking still missing |
| 4 | New Booking Service replaces booking in V5; Booking Portal on the web site; database partitioned (Bookings vs "V3 Balance") | Customers can book themselves (critical); the service architecture grows; migration away from the V3 schema begins | Not stated in the lecture |
Two things stand out. Stage 1 is the thin-versus-thick client trade-off from Workshop 10 (§8.9) in practice: a remote-desktop thin client depended on the network for everything, and moving the processing onto the operators' PCs fixed the lag. And Stages 3 and 4 pull pricing and booking out of the monolithic V5 into shared services that both the operators' clients and the customers' web site use: the large-scale version of Low Coupling, High Cohesion and Protected Variations (§8.4).
Lessons
Listen, then analyse
The client's perspective is critical, but analysis is needed to get the full picture.Understand the business
Missing key elements, such as the workflow or the interface requirements, can make a system unusable.The path is the hard part
Knowing where you want to get to is easy; planning and executing an acceptable path there is the real challenge, and design helps by providing options.The case gives you a realistic pattern for a Q6 answer: a client complaint becomes a quality attribute (a factor), the factor is traced to its architectural cause, the options are compared with their pros and cons, and a decision is justified and staged. Its responsiveness and reliability problems, for instance, would make good Factors for a technical memo, with the three options as the Alternatives considered.
Check yourselfThe operators complained the system was "slow". Why was rewriting the slow code not the answer?
Because the cause was architectural, in the deployment: every operator used Remote Desktop over the internet to a remote server with shared, limited bandwidth, so the UI froze regardless of how good the code was. Stage 1 fixed it by running V5 locally as a thick client. This is why analysis must trace symptoms to causes before choosing a solution.
Check yourselfWrite the Alternatives box of a memo for the "Take Control" decision, using the case's options.
COTS product: rejected; quick and cheap to start, but it doesn't fit how this business differs and gives no control of the software. Rebuild from scratch: rejected; fits current needs, but high cost and a long delay before it is available. (Chosen: modify the existing system, once a willing developer was found, accepting an uncertain cost and delay for an easier business transition and control of the software.)
- Complaints (slow, down, missing features) became quality attributes (responsiveness, reliability, modifiability) traced to the deployment and the coupled V3/V5 design.
- Of COTS, rebuild and modify, the client chose to modify ("Take Control"), in four stages: thick client, database to AWS, Pricing Service + Web Site, Booking Service + Portal.
Common Mistakes and the One-Glance Summary
The workshop review slides list no architecture-specific errors, so this list is drawn from the lecture's "worse versus better" examples, the exam's marking criteria and Larman's warnings. Read it the night before the exam.
- Choosing a requirement that isn't architecturally significant ("record the patient's date of birth", a 12 pt font). Ask: does it force a large-scale decision?
- Not saying which is the FR and which the NFR, or choosing two that overlap (S3d access rules with S5 security).
- Describing architectural analysis generically, with no examples from the scenario.
- Forgetting one of the three parts: describe AA, why it is important, why each requirement is significant.
- Leaving out the resolution step. AA is identify and resolve.
- Justifying significance with "it's important to users". Say why the architecture changes: cross-cutting, external, legal priority, costly to retrofit, variability, trade-offs.
- A Solution that restates the requirement ("the system will be secure") instead of describing architectural mechanisms.
- A solution pitched at class or method level, with no layer, subsystem or interface structure.
- A Motivation that doesn't link back to the factors, priorities or business goals, or ignores trade-offs.
- Alternatives listed without reasons for rejection.
- An empty "Unresolved issues" box. Give at least one genuine open question.
- A memo about a different requirement from the one chosen in Q6.1, or one covering several unrelated requirements.
Spot the errors: layers and package diagrams
- Solid line used for a dependency. Package dependencies are dashed lines with an open arrowhead.
- Upward dependency: Domain depends on UI. Coupling goes downward; if the domain must notify the UI, use Observer through an interface.
- A cycle between Domain and Technical Services. No cycles: factor out the shared types, or depend on an interface in a new package.
- The database drawn as the bottom layer, mixing the logical and deployment views. Model the data need as a Domain sub-domain plus a Persistence partition.
- Model-View Separation broken twice: the domain's
Salereferences a concrete window, and the window holds application logic (calculateTax). Use a Controller going down and an Observer coming up.
- Drawing dependency arrows the wrong way round: the arrow points to the depended-on (lower) package.
- Treating "tier" and "layer" as the same, or thinking three-tier means three machines.
- Thinking strict layering is the norm for information systems, when the norm is relaxed layering.
- Confusing the domain model (conceptual) with the domain layer (the software classes it inspires).
- Over-engineering: protecting against every speculative evolution point rather than picking your battles.
Check yourselfA memo's Alternatives box reads: "1. Use a NoSQL database. 2. Use microservices." What mark-losing mistake is this, and how would you fix it?
The alternatives are listed without reasons for rejection or deferral, so they show no reasoning. Fix each with a reason tied to the factors: e.g. "NoSQL database: rejected, because the legal record-keeping factor needs transactional writes of the change and its ledger entry together" and "Microservices: deferred, because the short time-to-market (S6) and a small team make the extra deployment complexity too costly now; kept as an evolution point."
The one-glance summary (for your notes sheet)
- Architecture is the large-scale organisation of a system: the significant decisions about structural elements, interfaces, collaborations, composition and style. They are hard to change, so analyse early and record the rationale.
- Architectural analysis identifies the factors, understands their variability (current flexibility and evolution) and priority, then resolves them; it deals with NFRs in the context of FRs. It matters because it means fewer missed critical factors, effort focused on high priority, and alignment with business goals.
- An ASR is a requirement with a large design impact; test it with WIDEST. A variation point exists now; an evolution point is speculative future variation. Priorities: inflexible constraints (safety, security, legal), then business goals, then other goals.
- A quality scenario is
<stimulus> <measurable response>plus the environment, and must be testable. The factor table has six columns: Factor; Measures & quality scenarios; Variability; Impact on stakeholders, architecture, other factors; Priority for success; Difficulty or risk. - A technical memo opens with the Issue and a Solution summary, then Factors, Solution, Motivation, Unresolved issues and Alternatives, each alternative with a rejection reason.
- The principles are LC, HC and PV at the large scale, plus separation of concerns; cross-cutting concerns go in a separate subsystem with a Facade, in Decorators/containers, or in AOP. Pick your battles.
- The layers of an information system are UI, Application, Domain, Business Infrastructure, Technical Services and Foundation, with coupling downward; relaxed layering is the IS norm, strict is for protocol stacks; partitions are horizontal and "tiers" is ambiguous.
- Connecting layers: SSD system operations go from the UI to a Controller; a Facade gives downward access to subsystems; Observer (or a UIFacade) handles upward communication. Model-View Separation: no coupling from the domain to the UI except through listener interfaces, and no application logic in the UI.
- Package diagram: tabbed folder; nesting embedded, as
A::B, or with the circle-cross; dependency is a dashed open arrow to the depended-on package; «subsystem»; no external resources drawn as a layer. Component diagram: ball = provided, socket = required, plus assembly connector, port and delegation connector.