Part VIII

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.
8.1

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.

How Part VIII is examined

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

Software architecture

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.

Architecture = the set of significant decisions about the organisation of a software system Structural elements What are the classes,components andsubsystems? NEXTGEN Sales, Payments andPricing packages; aPersistence subsystem Interfaces How are the elementscomposed, and throughwhat interfaces? NEXTGEN ITaxCalculatorAdapterPOSRuleEngineFacade Collaboration How do the elements worktogether to carry outthe business logic? NEXTGEN UI → Register → Sale;Sale notifies the UIthrough Observer Composition How are the elementsgrouped into larger andlarger subsystems? NEXTGEN packages → layers(UI / Domain /Technical Services) + Architectural style What overall styleguides all of this? NEXTGEN the Layers pattern
The four decision areas, plus style. The first four cards are the decision areas proper; the dashed fifth card is the overall style that guides them. Notice that every example is big: a whole package, a whole interface, a whole layer. That is the common thread of every definition of architecture: large scale, the big ideas in a system's motivations, constraints, organisation, patterns, responsibilities and connections (Larman §13.4).

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.

1. Many elements dependon it (high fan-in) the decision change it and every arrow ripples 2. Assumptions getscattered XPXPXPXP XPXPXP XPXPXPXP hundreds of edits across millions of lines productName = "XP" one config entry: 1-line change 3. Externalcommitments our system licence vendor platform hardware contracts you cannot just rewrite 4. Later decisions arebuilt on top class & method decisions subsystemsubsystem architectural decisions move the bottom block and everything above it moves
Four reasons architecture is hard to change. Panel 2 is Larman's Windows XP story: the product's name was changed at the last minute, nobody had treated the name as an evolution point, so a team had to search millions of lines of code and images to make hundreds of edits. Kept in one configuration file, it would have been a one-line change.

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).

LOGICAL VIEW: classes in packages and layers UI Domain Technical Services no machines,no processes,no OS DEPLOYMENT VIEW: software on nodes «device»:ClientPC UI «device»:AppServer Domain TechnicalServices HTTP deployment modelmaps layers to nodes
Same software, two views. The left picture says nothing about computers; the right one is just one way to deploy it. The same three layers could equally all run in one process on one handheld device. This is why you must never draw a database server or a machine inside a logical layer diagram (§8.6).

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.

In short
  • 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).
8.2

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.

Architectural analysis

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.

today maybe in 3 years time Variation point Variation that exists in the current requirements. • several tax-calculator interfaces must be supported • discount strategies differ Evolution point Speculative variation that may arise in future, but is not in today's requirements. • wireless handheld POS terminals in three years
Now versus maybe. A variation point is certain (it is in the requirements), so you must design for it. An evolution point is a guess, so you must judge whether protecting against it is worth the cost; §8.4 gives the rule for that judgement.

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.

Reason 1

Reduce the risk of missing something central

A critical factor found late means expensive rework, or even project failure.
Reason 2

Avoid effort on low-priority issues

Effort goes to the high-priority, high-impact factors instead. "Pick your battles."
Reason 3

Align the product with business goals

Time-to-market, target customers, legal obligations and cost.

Architecturally significant requirements

Architecturally significant requirement (ASR)

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.

FFunctional auditing, licensing,localisation, mail, printing,reporting, security andaccess control, workflow,external integrations UUsability UI consistency andaesthetics, many usertypes or devices,accessibility RReliability availability ("up time"),accuracy, recovery fromfailure, fault toleranceand failover PPerformance throughput, response time,recovery, start-up andshutdown time,resource use SSupportability testability, adaptability,maintainability,configurability, scalability,localisability,installability +Implementation languages, tools, hardware,resource limits; schedule,skills and cost constraints +Interface constraints imposed byexternal systems: paymentgateways, credit agencies,government services +Ops, Packaging, Legal system management;licensing; legal compliance(tax rules, privacy,record keeping)
FURPS+ as a factor checklist. Gold tiles are the categories that, in practice, influence architecture most strongly. Notice that security sits under Functional in FURPS+; this matters when you classify an ASR in the exam (the official 2021 answers follow it).

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.

Lecture: significant functional requirements

Auditing (audit trails), Licensing, Localization, Mail, Online help, Printing, Reporting, Security (protecting access to resources or information), System management, Workflow.

Lecture: significant non-functional requirements

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.

W Wide scopecross-cutting affects manyfeatures, layers orcomponents, notone class I Inflexiblehigh priority legal, safety orsecurity constraint,or a key businessgoal: fails without it D Difficultcostly to change later needs a structuraldecision (subsystem,framework, product);retrofit would ripple E Externaloutside our control payment gateway,credit agency,printers, identityprovider S Shiftingvariation / evolution varies per customernow, or will likelychange: needsProtected Variations T Trade-offswith other factors security vs usabilityor performance;anything vs costand schedule
WIDEST: six tests for significance. Each tile gives the test and the kind of sentence to write. In an answer you might say: "S4 is significant because it is wide (every payment path), inflexible (a legal requirement) and difficult to retrofit."

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.

Architecturally significant "Deployed on WindowsServer or Linux" platform constraint:drives technology andportability choices E · D "Log the activity (e.g.page views) of eachstudent" auditing and logging:cross-cutting; affectsperformance, storage W · T "Student lists fromthe Universityenrolment system" external interface:needs an Adapter andcopes with its uptime E · S Not significant "Default font size 12 pt" just a local UI setting: cheap tochange, lives in one place, forcesno large-scale decision no WIDEST letter applies
The LMS poll, sorted. The small letters under each card are the WIDEST tests it passes. The quick question to ask of any requirement: does it force a large-scale decision?
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.

The architectural analysis loop
FROM INCEPTION • SupplementarySpecification • use cases: SpecialRequirements andTechnology Variations • Open Issues 1 · Identify and analyse factors non-functional: thoroughly functional: especially their variability record each factor in FactorScenarioVariabilityImpactPrio.Risk HMHLLH kept in the Supplementary Specification significantimpact only 2 · Resolve the high-impact factors analyse alternatives, create solutions order: constraints → business → other POSSIBLE DECISIONS remove the req. build custom buy a product hire an expert stop the project architectural decisions → technical memos kept in the Software Architecture Document revisit every iteration, and before each new release
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. 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).
  7. 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.

resolve first → last 1 · Inflexible constraintssafety, security, legal 2 · Business goalstime-to-market, customers, cost 3 · Other goalsusually trace to business goals "The POS must apply tax rules correctly." A trade-show demo in 18 months; a competitor-driven window of opportunity; features for European stores. "Extendible: add a feature in 10 person-weeks" … traces to "a new release every 6 months".
Legal beats business beats everything else. In a Q6 memo, saying "this is an inflexible legal constraint, so it takes top priority" is a quick, mark-earning link to this hierarchy.

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.

Theme 1

Mostly non-functional

…but with awareness of the business context. Functional requirements provide the context, and their variability is architecturally significant.
Theme 2

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.
Theme 3

Interdependencies and trade-offs

Security against performance or usability, and nearly everything against cost.
Theme 4

Generate and evaluate alternatives

Including buying or reusing third-party hardware and software, not only building.

Architecture in the UP: iterative, not waterfall

Inception Elaboration Construction and later releases architectural analysis effort • analysis starts; factorsrecorded • if unsure the ASRs can bemet: architectural proof-of-concept ("ArchitecturalSynthesis") • the focus of architectural analysis • early iterations program and test thearchitecturally risky elements first • the architecture stabilises through code,not "PowerPoint architecture" • revisited before each new release • the SAD is completed once thecode stabilises Factors (factor table) → Supplementary Specification Decisions (technical memos, views) → SAD
Architecture is never "done up front". The effort peaks in elaboration but never drops to zero. Note where each result is kept: factors in the Supplementary Specification, decisions in the SAD (§8.9).
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.

In short
  • 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.
8.3

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

Quality scenario format

<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.

FORMAT stimulus measurable response + environment / conditions 1 · stimulus "When the completed sale is sent to the remote tax calculator to add the taxes, the event that triggers it 2 · response the result is returned what the system does 3 · measure within 2 seconds 'most' of the time, vague: "most" must be definedbefore it can be tested 4 · environment measured in a production environment under 'average' load." vague: "average" must bedefined too LARMAN'S SECOND EXAMPLE "When a bug report arrives from a beta-test volunteer, reply with a phone call within 1 working day." stimulus · response · measure (here the environment is implied: the beta-test programme)
Four parts, two of them flagged. The response and the measure together make the measurable response. Larman's own example still contains two vague words: until "most" and "average" are defined, the scenario cannot actually be tested.

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.
From a vague wish to a testable scenario
Vague: "The POS should recover well from remote service failures." ✗ untestable: recover how fast? when? STIMULUS When a remote servicefails, what happens? RESPONSE re-establishconnectivity what does the system do? MEASURE within 1 minute of its detectedre-availability, how fast, how often, how much? ENVIRONMENT under normal store loadin production. under what conditions? Scenario: "When a remote service fails, re-establish connectivity within 1 minute of its detected re-availability, under normal store load in production." ✓ testable✓ environment stated✓ a make-or-break quality (retailers hate lost sales)
  1. 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?
  2. Stimulus: name the event that triggers the requirement. Here, a remote service (such as the tax calculator) fails.
  3. Response: say what the system must do in reply: re-establish connectivity with the remote service.
  4. Measure: attach a number. Within 1 minute of the service being detected as available again. Together with the response, this is the measurable response.
  5. Environment: under normal store load, in production. Without this, a test on a quiet development machine could "pass" meaninglessly.
  6. 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.
Exam template for a quality scenario

"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.

Grouped under FURPS+ headings, e.g. Reliability—Recoverability 1 · Factor 2 · Measures & qualityscenarios 3 · Variabilitycurrent flexibility + future evolution 4 · Impactof the factor and its variability 5 · Priorityfor success 6 · Difficultyor risk a short name forthe requirement "Recovery fromremote servicefailure" the measurable statement(s):stimulus + measurableresponse + environment testable, no vague words Current flexibilityhow much leeway exists nowe.g. "SME says simplified is OK" Evolutionlikely future change, with itsprobability • on stakeholders: whocares and why • on the architecture: howbig the design impact is • on other factors: whichones it interacts with H/M/Lfollows thepriorityhierarchy H/M/Lhow hard orrisky toachieve
Six columns, learn them in order. Column 3 always has two parts (now and future, with a probability), and column 4 always has three targets (stakeholders, architecture, other factors). The last two are just H, M or L.

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 table, NextGen POS (Larman Tables 33.1 and 33.2)
FactorMeasures & quality scenariosVariability (current flexibility and evolution)Impact on stakeholders, architecture, other factorsPriorityDifficulty / risk
Reliability—Recoverability
Recovery from remote service failureWhen 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.HM
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.…HL
Support wireless PDA terminals?Adding them requires no change to the non-UI layers.Not needed now, but very likely within 3 years.…LH
Legal: current tax rules must be appliedAn 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.HL

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.

FactorMeasures & quality scenariosVariabilityImpactPri.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.HM
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.HH
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.

In short
  • 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.
8.4

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.

Interface + factory / lookup ServicesFactory «interface»ITaxCalcAdapter AdapterA AdapterB which adapter? readfrom configuration implementation chosen at configuration or run time Data-driven design store.config brandName = "…"taxRate = 0.10logo = brand.png application a change of brand is an edit to oneentry, not a code change Rule engine (interpreter) :Register isInvalid(…) «subsystem»RuleEngine rules file:if … then reject rules change withoutrecompiling the system
Three ways to bind late. In each, the thing that varies (the vendor, the brand, the business rules) is kept out of the compiled code and chosen at configuration time or run time. The left panel is Protected Variations through an interface; the middle one is the Windows XP lesson applied.

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.

Sale getTotal()checkPermission()writeAuditRecord()saveToDB() Payment getBalance()checkPermission()writeAuditRecord()saveToDB() Register enterItem(id, qty)checkPermission()writeAuditRecord()logEvent() database API,security API,log files
woven in Every domain class carries security, audit and persistence code (red). Cohesion drops, and every class is coupled to every technical API.
Domain Sale Payment Register Technical Services «subsystem»PersistencePersistenceFacade «subsystem»SecuritySecurityFacade «subsystem»LoggingLoggingFacade
separated Domain classes keep only domain logic and call down to one subsystem per concern, each behind its facade. This is technique 1 below, and it is what a layered architecture does.

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.

1 · Separate subsystem + Facade :Sale «subsystem» Persistence PersistenceFacade save(sale) most common · layers are an example 2 · Decorator / container container (e.g. EJB) securitycheck :Register inner object client wrapper adds the service, then forwards 3 · Post-compiler / AOP cleansource aspect:logging weaver(AspectJ) wovenprogram concern woven in after compilation
Three techniques, one goal: keep the concern's code out of the domain classes. (1) Put it in its own subsystem and call it through a Facade. (2) Wrap the object in a decorator or container that adds the service. (3) Let a post-compiler or aspect-oriented tool weave it in, so the source stays clean.

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.

an evolution pointspeculative future change Estimate the cost of makingthe change later, when it isactually needed only a fewperson-weeks? yes no Defer it.Protecting now would be over-engineering:expensive, and often wrong. Protect it now (Protected Variations).Ignoring it would be under-engineering:the Y2K mistake. Coupling to stable things (Java libraries, the Foundation layer) needs no protection at all.
"The art of the architect is knowing what battles are worth fighting." Only unstable variation and evolution points need protecting, and only when changing later would be expensive.

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 typeTypical architectural solutionPattern link
External services that vary between installationsCommon interface + Adapter per vendor, created by a ServicesFactoryProtected Variations, Indirection, Adapter, Factory
Unreliable remote servicesProxy that fails over to a local simplified service and retries the remote one; local cache; store-and-forwardProxy, Adapter
Access to a complex subsystemOne Facade with a few coarse-grained operationsFacade
Cross-cutting (security, audit, persistence, logging)A separate Technical Services subsystem behind a facade; Decorator or container; AOPPure Fabrication, Facade, Decorator
Several user interfaces or devices; usabilityModel-View Separation; an Application layer of controllers or session facades; Observer for pushing updates to the UIController, Observer
Business rules or branding that vary per customerData-driven configuration; Strategy; rule engine behind a facadeStrategy, Protected Variations
Performance or scalabilityCaching; coarse-grained remote interfaces; distributing the Domain or Technical Services layers; asynchronous messaging—
Tight schedule or limited skillsBuy, reuse or outsource components; cut scope ("remove the requirement")—
Legal complianceBuy 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.

In short
  • 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.
8.5

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.

Technical memo

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.

LARMAN AND THE LECTURE · 7 PARTS 2021 EXAM ANSWER BOXES · 5 PARTS 1 · Issue Category—Name → first line of Factors 2 · Solution Summary one line → first line of Solution 3 · Factors 4 · Solution 5 · Motivation 6 · Unresolved Issues 7 · Alternatives Considered Factors Issue: Reliability—Recovery from … Solution Summary: … (optional) Motivation Unresolved Issues Alternative Solutions (renamed)
The exam keeps the last five parts. Parts 3 to 7 map straight across (Alternatives Considered is renamed Alternative Solutions). The Issue and the Solution Summary have no box of their own, so write the Issue title as the first line of Factors and, optionally, the summary as the first line of Solution.

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.

BoxA good answer gives…A weak answer…
FactorsThe 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.
SolutionConcrete 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.
MotivationWhy 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 issuesGenuine 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.
AlternativesTwo 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.

ServicesFactory «create» «interface»ITaxCalculatorAdapter +getTaxes(sale) «smart proxy»TaxCalculatorProxy +getTaxes(sale) On each call: is the remoteservice back? If so, redirect toit, meeting the 1-minutereconnection scenario. RemoteTaxAdapter LocalTaxAdapter remote1 local1 simplified: constant tax rates remote tax calculator service Product descriptionsa small cache of the most common products Inventory updatesstored, then forwarded on reconnection OTHER LOCAL STAND-INS (both adapters also implement ITaxCalculatorAdapter)
Protected Variations on the location of a service. Clients only ever see 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.)
Technical memo · course example, condensedIssue: Reliability—Recovery from Remote Service Failure
Solution summary
Location transparency using service lookup, failover from remote to local, and partial local replication.
Factors
Robust recovery from failure of remote services (tax calculator, inventory) and of the remote product database (descriptions, prices).
Solution
Achieve Protected Variations on the location of services, using an Adapter created in a ServicesFactory. Where possible, provide simplified local implementations: constant tax rates, a small cache of the most common products, and inventory updates that are stored and forwarded on reconnection. Smart Proxy objects test on each call whether the remote service is back, and redirect to it as soon as possible, which meets the 1-minute reconnection scenario.
Motivation
Retailers don't want to stop making sales, and no competitor offers this, so it is a selling point. The cache is small because client resources are limited. The real tax calculator isn't replicated on clients because of its licensing cost and the almost weekly configuration effort it needs. The design also supports the evolution point of retailers who later pay for full local replication.
Unresolved issues
None.
Alternatives considered
A "gold level" quality-of-service agreement with the remote credit authorisation services. It was available, but much too expensive.

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.

Larman memoLegal—Tax Rule Compliance
Solution
Buy a tax calculator with a licence that includes rule updates.
Motivation
Time-to-market, correctness, low maintenance and happy developers; the cost is accepted.
Unresolved
Which products lead the market?
Alternatives
Build our own: rejected as too slow and error-prone, and it creates a costly ongoing maintenance burden.
Larman memoAdaptability—Third-Party Services
Solution
Common lowest-common-denominator interfaces, with an Adapter per product (Protected Variations through Indirection).
Motivation
Simpler, cheaper and faster than messaging.
Unresolved
Will the lowest-common-denominator interface prove too limited?
Alternatives
Publish-subscribe messaging (JMS) with adapters: rejected because it can't connect directly to the credit authoriser, reliable implementations are costly, and it gives more delivery reliability than needed.
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.

In short
  • 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.
8.6

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.

Definitions exam

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.

more application-specific → more general and reusable UI(Presentation, View) GUI windows, reports, speech interface, HTML / JSP / JavaScript; captures user events Application(Workflow, Process, Mediation, App Controller) handles requests from the UI; workflow, session state, window / page transitions; consolidates and transforms data for presentation Domain(Business, Application Logic, Model) handles requests from the Application layer; implements domain rules; domain services (POS, Inventory) that may be shared by several applications Business Infrastructure(Low-level Business Services) very general business services used across many domains, e.g. a CurrencyConverter Technical Services(Technical Infrastructure, High-level Technical Services) relatively high-level technical services and frameworks: Persistence, Security, logging Foundation(Core Services, Base Services, Low-level Technical Services) low-level utilities: data structures, threads, maths, file, DB and network I/O
Six layers, dependencies pointing down. As in Larman's figure, each layer's width suggests its range of applicability: the UI serves one application, Foundation serves almost anything (this widening is not standard UML). The simplest version, used in Larman ch. 13 and in most exam answers, keeps just three: UI → Domain → Technical Services.

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.

UI Domain Technical Services Foundation
strict A layer calls only the layer directly below. Common in network protocol stacks (OSI), but not in information systems.
UI Domain Technical Services Foundation e.g.logging
relaxed A higher layer may call several lower layers (also called transparent layering): the UI calls the Domain and also Technical Services for logging. This is the norm in information systems.

Guidelines for designing with layers exam

  1. Organise the large-scale structure into distinct, cohesive layers, running from application-specific at the top to general, low-level services at the bottom.
  2. 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.
  3. 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).
  4. Don't show external resources as the bottom layer (Larman Fig. 13.7). See the pair of diagrams below.
  5. Name domain-layer classes after the domain model (see "Domain layer versus domain model" below).
UI Domain Technical Services Foundation MySQL Novell LDAP
worse A database and a directory server drawn as the bottom "layer". They are physical components, so this mixes the logical and deployment views.
UI Domain Sales Inventory Technical Services Persistence Naming andDirectory Services Foundation
better Model the need for particular data (inventory data) as a sub-domain package in the Domain layer, and general database access as a partition of Technical Services. The real database belongs in a deployment or component diagram.

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 layersHow 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.

LAYERS (vertical) AND PARTITIONS (horizontal) UI Swing Web Domain POS Inventory Tax TechnicalServices Persistence Security Logging layers partitions: parallel subsystems within one layer TIERS Originally a logical layer; now commonly a physical processing node or cluster. client tier server tier Larman avoids the word because it is ambiguous. In an answer, say "layer" for logical and "node" for physical.
Three different ideas. A layer is a slice in the vertical stack of the logical architecture. A partition is a horizontal division of one layer into relatively parallel subsystems (Technical Services into Persistence, Security, Logging; Domain into POS, Inventory, Tax). A tier usually means a physical node today.

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.

Two-tier window definition application logic +SQL reads and writes DB quick at first; fine for simple CRUD only Three-tier on 2 nodes Interface ApplicationLogic Storage "thicker client" logic runs on the client node Three-tier on 3 nodes Interface ApplicationLogic Storage "thinner client" the client only shows the interface
Three-tier is a logical idea. The same three tiers can be deployed on two nodes or three, which is why "three-tier" does not mean "three machines". Two-tier designs are quick to build at first but suffer every problem in the table above; even so, they are acceptable for simple CRUD, data-intensive systems.

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.

MVC TERMARCHITECTURAL LAYER View Controller Model UI layer Application layer (workflow objects) Domain layer
MVC at the large scale. Model-View Separation is MVC's key principle, and it is the subject of §8.7.

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.

DOMAIN MODEL · conceptual perspective (analysis) Paymentamount a real-world concept:no methods, no types needed Domain layer software perspective (design) Payment -amount: Money+getBalance(): Money a software class with application logic inspires namesand definitions lower representational gap software that looks like the stakeholders' vocabulary is easier to understand and change
Two different artefacts, one vocabulary. The conceptual 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.

In short
  • 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.
8.7

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

Model-View Separation
  1. Do not connect or couple non-UI objects directly to UI objects. For example, a Sale must not hold a reference to a Swing JFrame, 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.
  2. 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.

UI LAYER DOMAIN LAYER ProcessSaleFrame +onEnterItemClicked()-calculateTax() Sale -frame: ProcessSaleFrame+makeLineItem(desc, qty) frame.display(total) 1 2
breaks it (1) The domain object holds a concrete window and tells it what to do, so Sale cannot be reused with any other UI. (2) The window calculates tax, so that logic cannot be reused or tested without the window.
UI LAYER DOMAIN LAYER ProcessSaleFrame Register Sale «interface»PropertyListener register * implementsthe interface
follows it The window delegates to the controller and holds no logic. 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.

UI LAYER DOMAIN LAYER (or shared) ProcessSaleFrame +onPropertyEvent(source, name, value) «interface»PropertyListener +onPropertyEvent(source, name, value) Sale -total: Money +addPropertyListener(lis: PropertyListener)-publishPropertyEvent(name, value) propertyListeners*
The dependency goes from Sale to the interface only, never to the concrete window. 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.

UI → Controller → Domain, and Observer back up
UI LAYER DOMAIN LAYER :Cashier :ProcessSaleFrame :Register :Sale enterItem(id, qty) enterItem(id, qty) system operation crosses the layer makeLineItem(desc, qty) onPropertyEvent(s, "sale.total", total) Sale sees the frame only as aPropertyListener (Observer) totalField.setText(…) ↓ calls go down (Controller) ↑ updates come up only through an interface (Observer)
  1. 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 calling addPropertyListener(this).
  2. 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.
  3. 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.
  4. The controller delegates the real work to the domain: makeLineItem(desc, qty) on the Sale. The controller itself does no business logic.
  5. 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.
  6. The frame displays the new total with totalField.setText(…). Display only: no calculation happens in the UI.
  7. 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.

SSD: THE SYSTEM AS A BLACK BOX :Cashier :System enterItem(id, qty) DESIGN: THE BOX OPENED :Cashier :ProcessSaleFrame :Register button click enterItem(id, qty) the same message
The messages on the SSD are exactly the messages sent from the UI layer to the domain layer. The SSD simply leaves the UI object out. Opening the box shows who receives each system operation: the controller.

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.

UI DOMAIN TECHNICAL SERVICES ProcessSaleFrame Register Sale onPropertyEvent(…)via PropertyListener system operations(from the SSD) «subsystem» PersistenceFacade Persistence «subsystem» POSRuleEngineFacade POSRuleEngine(wraps Jess) isInvalid(lineItem, sale) save(…) Controllerreceives the systemoperations coming down Observercarries updates up,only via an interface(or a UIFacade) Facadeone public entry persubsystem, with a fewcoarse-grained operations
Three patterns at the layer boundaries. Controller where the UI meets the domain, Facade where the domain meets each subsystem, Observer for the rare trip back up. (Messages are illustrative except isInvalid(lineItem, sale), Larman's example of a coarse-grained facade operation.)
Package versus subsystem

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.

GUI LAYER DOMAIN LAYER ChoosePizzaPage CartPage CheckoutPage Order Pizza OrderLineItem Customer
high coupling Every page talks to every domain class it needs. Replacing the GUI would ripple into the domain.
GUI LAYER DOMAIN LAYER ChoosePizzaPage CartPage CheckoutPage OrderHandlercurrentOrder Order Pizza OrderLineItem Customer
one point of coupling All ordering operations from the GUI go to 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.

In short
  • 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).
8.8

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

1 · Package Sales tabbed folder; name in the bodywhen the contents are hidden 2 · Members shown Sales Register Sale name moves to the tab; show onlya few noteworthy types 3 · Nesting: embedded UI Swing Web inner packages drawn inside 4 · Nesting: qualified names UI::Swing Domain::Sales java::util::Date Outer::Inner, also for classes 5 · Nesting: circle-cross UI Swing Web circled cross at the owner end 6 · Dependency UI Domain dashed, open arrowhead pointingto the depended-on package 7 · Subsystem «subsystem» Persistence PersistenceFacade a discrete engine with behaviourand interfaces, often with its facade 8 · Path in a lifeline :Domain::Sales::Register enterItem highlights where a messagecrosses into a layer
Everything you need to read and draw a package diagram. Panels 3, 4 and 5 are three alternative ways of showing the same nesting. The dependency in panel 6 can come from a package or a type and point to a package or a type. Plain dependency lines are ideal when you only want to show that there is coupling, not what kind (attribute, subclassing…).

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.

Drawing NextGen's layered package diagram
UI Domain Technical Services Swing Web Sales Payments Taxes Persistence Logging RulesEngine ProcessSaleFrame Register Sale «interface»ITaxCalculatorAdapter relaxed:UI may skipto Logging «subsystem» PersistenceFacade «subsystem» POSRuleEngineFacade MySQL not in a logicalview: deployment a blank page
  1. Start with a blank page and the six-step procedure.
  2. 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.
  3. 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).
  4. Step 3: optionally show a few key types: here the window, the controller Register and the adapter interface ITaxCalculatorAdapter. Note that the Swing package holds our GUI classes built on Swing, not the Swing library itself.
  5. Step 4: add dashed dependency arrows pointing downward only. Relaxed skips are allowed, such as the UI using Logging directly, but avoid cycles.
  6. Step 5: mark the real subsystems «subsystem», each with its facade: Persistence behind PersistenceFacade, the rules engine behind POSRuleEngineFacade.
  7. 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.
A cycle A B a change to either may breakthe other; neither can bereused or released alone Fix 1 · factor the cyclic types out A B C new package for the shared types Fix 2 · depend on an interface A B «interface»IX A's class implements IX B uses IX interface in a new package
Two ways out of a cycle. Either move the types that both packages need into a new package (fix 1), or put an interface in a new package so the lower package depends on the interface instead of the concrete class (fix 2). Either way every arrow ends up pointing one way.
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.

In short
  • 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.
8.9

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.

Exam note

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

Component (UML, quoted in the lecture)

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.

1 · Component «component»:Booking keyword, icon, or both;an instance is written :Name 2 · Provided interface Services ISearch ball (lollipop): "this componentimplements / offers the interface" 3 · Required interface UI ISearch UI «interface»ISearch socket: "uses / needs it"; or a dashedarrow to an «interface» box 4 · Assembly connector UI Services ISearch ball in socket: a required interfacesatisfied by a provided one 5 · Port + delegation :Hotel System :Booking port = square on the boundary;delegation: port → inner part 6 · Subsystem component «subsystem»Payments internal structure :CardAuth :Ledger parts shown inside a compartment 7 · Realisation (class style) «interface»ISearch SearchService dashed + hollow triangle; or usethe lollipop (panel 2) instead 8 · Dependency Services Domain dashed arrow betweencomponents or interfaces
Component notation (lecture slides 31 and 35–36, Workshop 10 review slide 8). Remember it as ball = provided, socket = required, and a ball sitting in a socket is an assembly connector. Interface names here are illustrative.

Workshop 10: from block diagram to component diagram

  1. Start with an informal block diagram: named boxes joined by lines, with no formal notation.
  2. Formalise it as a component diagram with ball-and-socket interfaces.
  3. The hotel-booking example below shows the result.
  4. Notice that this is still a layered structure: UI, then Services, then Domain.
«component»Web framework React.js, Material UI «component»UI Registration · Login · Booking · Search pages «component»Services Authentication · Booking · Search Authentication Booking Search «component»Domain User · Booking · Hotel/Room «component»PostgreSQLdatabase Search · Booking · User UI LAYER ABOVE SERVICES IN THE MIDDLE DOMAIN AT THE BOTTOM
Workshop 10's hotel-booking system as components. Every socket belongs to the component that needs the service; every ball to the one that provides it. Read top to bottom and it is still a layered architecture. The two external components (web framework, database) plug in the same way as the internal ones, which is what "replaceable" means.

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.

  1. 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.
  2. 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).
  3. 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).
  4. 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 CreditAgencyAdapter plus store-card accounts that use a discount Strategy; an Inventory service; a SecuritySystemAdapter that 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.
Thin client :MSTweb interface only :Serversale logicsales loginventory + simple MST; one place for data− network and server: single points of failure Thick client :MSTmobile app: mostof the sale here :Serverlogging sales + survives short drops; faster; store-and-forward− logic and data on many devices to secure Fully distributed peers :MSTlog copy :MSTlog copy :MSTlog copy + no central server− integrity, security, consistency much harder
Three ways to deploy the MSTs. The pros and cons (in green and red) are the study guide's worked answer to point 4, not part of the official solution. Whichever you choose, the factor table and a technical memo should record why.

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»:StorePC «executionEnvironment»:JVM «artifact»nextgen-client.jar «device»:AppServer «executionEnvironment»:ServletContainer «artifact»nextgen.war «device»:DBServer «executionEnvironment»:DBMS «device»:TaxService «HTTP» «SQL» «SOAP»
Deployment notation, illustrated. 3-D boxes are nodes: «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.

Software ArchitectureDocument (SAD) • architectural representation • architectural factors(reference to the factor table inthe Supplementary Specification) • architectural decisions= the technical memos • a set of views → purpose: summarise the bigideas for newcomers +1 · Use-case viewmost significant use cases Logicalpackage, class, interaction Processprocesses and threads Deploymentnodes, communication Data Security Implementationsource and deliverables: package, component Development every view includes a motivation section: why the architecture is this way
The SAD and its views. The N+1 (4+1) view model describes the architecture from several angles. The "+1" is the use-case view: the most architecturally significant use cases and their realisations, which tie all the other views together.
In short
  • 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.
8.10

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.

Q6.110 marks · about 10 minutes 1 FR + 1 NFR ASR, correctly classified,tied to sentence numbers (S4, S5…) Describe architectural analysis usingthis scenario for the examples Why it is important (Larman's three reasons) Why each requirement is significant (WIDEST) Q6.210 marks · about 10 minutes Relevance to the requirement chosen in Q6.1 Understanding of the memo's purpose andstructure (the five headings) A reasoned architectural argument: how thedesign choices address the requirement Plausible invented details are explicitly allowed
The question wording tells you what the marks reward. Allow about 1 minute per mark. The answers below are complete; if you must cut them down, the bold phrases mark the essential content.

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

Model answer · Sportsy Q6.1

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.

UI Mobile app Web Application MembershipController EventController ShopController Domain Memberships Events Shop «subsystem» Finance FinanceFacade +takePayment(…)+recordIncoming(…) / recordOutgoing(…)+getStatement(period) the only entry point for money Ledgerappend-only, immutableLedgerEntry objects ExportStrategyCSV, accounting-package format Technical Services PersistencePersistenceFacade «interface»IPaymentGateway CardGatewayAdapter PayPalAdapter ServicesFactory Logging one DB transaction:change + ledger entry
Sportsy's solution in one picture. Every money flow from every controller (gold arrows) goes through 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.
Q6.2 · technical memo · the study guide's model answerIssue: Legal—Recording of all financial transactions
1 · Factors
  • 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.
2 · Solution
  • 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, EventController and ShopController; Domain, with Memberships, Events, Shop and «subsystem» Finance; and Technical Services (Persistence, PaymentGateway adapters, Logging).
  • FinanceFacade (Facade) is the only entry point for anything involving money, with coarse-grained operations takePayment(...), recordIncoming(...), recordOutgoing(...) and getStatement(period). No other package may write financial data, and the package dependencies enforce this.
  • The ledger holds immutable LedgerEntry objects. 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 the PersistenceFacade, so either both are saved or neither is.
  • For external payment providers, an IPaymentGateway interface 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).
3 · Motivation
  • 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.
4 · Unresolved issues
  • 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.
5 · Alternative solutions
  • 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)

RequirementClass, and why significantMemo sketch: Solution · Motivation · Alternative
S3e, take paymentsFR (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 communicationFR (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-marketNFR (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 NFRNFR (+Legal), significant for the same reasons as above.Same memo, but say explicitly "FURPS+ +Legal".
The official answer (released 26/27 Oct)

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:

Official Q6.2 memo · SportsyLogging all financial transactions
Factors
The information must be accurate, complete and detailed for every financial transaction.
Solution
A log system that logs the intent, performs the transaction and then logs the outcome; it uses the Observer pattern to decouple transaction execution from logging, and sends the log to a central cloud-based log server.
Motivation
Meeting the legal obligations.
Unresolved issues
A failure to save the outcome remotely; the log would be saved later if the connection is lost, which leaves a trail to check.
Alternatives
A single log entry per transaction, or batching transactions for logging. Either would let transactions go ahead when the log server is unavailable, but at a greater risk of losing all record of some of them.

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.
Which way round to classify them (official answer, 26/27 Oct)

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

Model answer · Doctar Q6.1

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

UI Reception client Doctor client no access logic in the UI Application security Proxy / Decorator ConsultationController security Proxy / Decorator PrescriptionController Domain Patients Scheduling Consultations Prescriptions Technical Services «subsystem» Security SecurityFacade authenticate(…) +MFAauthorise(user, op, res) IIdentity-Provider(adapter) PersistenceFacade • encryption at rest (DB, backups)• TLS in transit• clinic (tenant) id filtered inevery query AuditLogappend-only recordof every read andwrite of patient data Printing check first: SecurityFacade.authorise(…) Foundation
Doctar's security design. Every system operation enters through an Application-layer controller, and a security Proxy/Decorator around each controller calls 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.
Q6.2 · technical memo · the study guide's model answerIssue: Security—Confidentiality of patient information
1 · Factors
  • 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.
2 · Solution
  • 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 ConsultationController and PrescriptionController; Domain (Patients, Scheduling, Consultations, Prescriptions); Technical Services («subsystem» Security, Persistence, AuditLog, Printing); and Foundation.
  • SecurityFacade provides authenticate(...) (with multi-factor authentication for doctors) and authorise(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 SecurityFacade before 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 PersistenceFacade filters 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 IIdentityProvider Adapter. Hosting is in an Australian data centre.
3 · Motivation
  • 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).
4 · Unresolved issues
  • 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.
5 · Alternative solutions
  • 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 ClinicProfile per tenant, and a BrandingService in 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 PrintingService facade, 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:

Official Q6.2 memo · DoctarStoring and managing confidential information
Factors
The data must be encrypted to preserve confidentiality both at rest and in transit.
Solution
A dedicated data encryption component that encrypts and decrypts sensitive information using strong, industry-standard algorithms; if the chosen encryption solution has complex APIs or workflows, a Façade gives the rest of the system a simple, consistent interface to it.
Motivation
Meeting legal obligations and reducing operational risk.
Unresolved issues
Access must still be restricted so that only authorised groups of users (doctors versus administrative staff, for example) can view or change particular data.
Alternatives
A third-party managed security service that handles encryption, key management and access control.

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.

Classification caution (official answers, 26/27 Oct)

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.

Q6.1 answer sheet≈ 10 minutes · fill the gold blanks from the scenario 1 FR ASR "S_: [requirement] — functional (FURPS+ F: [auditing / printing / integration / security…])" + one line on what it means 2 NFR ASR "S_: [requirement] — non-functional (FURPS+ [U / R / P / S / +Legal])" + one line on what it means; must not overlap slot 1 3 Definition AA identifies the factors that influence the architecture, understands their variability and priority, and resolves them; it resolves NFRs in the context of FRs; early elaboration, iterative (a specialisation of requirements analysis) 4 Step 1 Identify and analyse with FURPS+: [3–4 factors from the scenario, with S numbers]; factor table (6 columns); one quality scenario: "When [stimulus] under [conditions], the system [response] within [measure] in [x]% of cases" 5 Step 2 Resolve: alternatives and decisions (build, buy, remove the requirement, hire an expert); priorities legal/safety → business goals → others: [which factor goes first, and why]; recorded in technical memos 6 Importance Fewer missed critical factors ([late discovery of S_ would mean…]); focus on high priority ([…]); alignment with business goals ([time-to-market / customers / legal / cost]) 7 Significance For each ASR, 3+ WIDEST reasons tied to the scenario: [Wide · Inflexible · Difficult · External · Shifting · Trade-offs] + what failure would cost (the official answers' move): "without it, [legal failure / users won't adopt]" Check before moving on: both classified? sentence numbers? scenario examples in the AA description? resolution step included? all three parts answered?
Q6.1 as a fill-in sheet. The black text is the same for every paper; only the gold blanks change. Memorise the black, and practise filling the gold from a new scenario.
Q6.2 technical memo sheet≈ 10 minutes · five boxes, in this order Factors Issue: [Category]—[Name] · S_: [requirement], priority [H], risk [H/M/L] Related factors / trade-offs: [1–3, with S numbers] Scenario: "When [stimulus] under [conditions], [response] within [measure], verified by [test]" Solution Summary: [one line]. Layers: UI / Application / Domain / Technical Services. Owner: [«subsystem» X] accessed via [XFacade]; external variation via [IService] + Adapter + Factory. Plus where relevant: Proxy · Observer · Decorator · Strategy. Buy vs build: […]. Data and deployment notes: […]. Use concrete invented names. Motivation Satisfies [factor] because […]. Priority: legal → business → other. Principle: [LC / HC / PV / separation of concerns]. Supports evolution point [Y]. Trade-off accepted: [Z], because […]. Unresolvedissues Two real open questions: [legal detail for an SME?] [vendor choice / scale / edge case / is the interface sufficient?] Never leave this box blank. Alternativesolutions [Alternative 1]: rejected because [cost / time / risk / coupling / reliability]. [Alternative 2]: deferred because […]; kept as an evolution point.
Q6.2 as a fill-in sheet. Five boxes in the exam's order. Every alternative carries its reason; every solution names layers, an owning subsystem and patterns.
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.

In short
  • 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.
8.11

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.

CLIENT'S COMPLAINTQUALITY ATTRIBUTEARCHITECTURAL CAUSESOLUTION APPROACH "Slow, or hangs, while acustomer is on the phone" Responsiveness Remote Desktop over the internetto a remote server; shared, limitedbandwidth, so the UI froze Reduce internet traffic byhosting the system locally "When it's down we usepen and paper" Reliability Connection down = no system at all(everything ran remotely) Update the networkingsetup "No invoicing, reportingor customer portal" Functionalityreally aModifiability Two versions, both needed: V3 (VisualBasic 6) for bookings, V5 (C#, .NET 4)for customer management. Neitheraccessible for modification; bothpoorly designed and highly coupled Eliminate V3 (reimplementits functions in V5); make V5accessible for updates; addhigh-priority, low-complexityfeatures first (invoicing, reports)
Symptoms traced to causes. "Slow" and "keeps going down" were symptoms: the analysis traced them to the deployment (remote desktop over shared bandwidth), not to the code. The missing features turned out to be a modifiability problem.

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

OptionProsCons
1. Use a commercial off-the-shelf (COTS) productUp and running quickly; low starting costDoesn't fit how this business differs; no control of the software
2. Rebuild a whole new systemBuilt for the client's current needs and businessHigh cost; a long delay before it is available
3. Modify the existing system chosenEasier business transition; control of the softwareNeeds 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.

Chauffeured Cars: from remote desktop to services
Starting deployment Stage 1: V5 as a local thick client Stage 2: database moved to AWS Stage 3: Pricing Service and Web Site Stage 4: Booking Service, Booking Portal, DB partitioned «device»B&D 1 :PC «executionEnvironment» :Login Session «device»B&D 2 :PC «executionEnvironment» :Login Session :Remote Desktop :Remote Desktop :B&D System V5 :B&D System V5 thick client: runs locally thick client: runs locally Internet Internet Developer A's :Server «executionEnvironment» B&D :Virtual Machine B&D DB :SQLServer «executionEnvironment» 1 :Login Session :B&D System V3 :B&D System V5 «executionEnvironment» 2 :Login Session :B&D System V3 :B&D System V5 both versions, in every session, share one database V3 is gone: its booking functions now live in V5. No login sessions on the server any more. The V5 clients talk to the database directly, but it still sits on Developer A's server. «executionEnvironment»Amazon Web Services B&D DB :SQLServer «executionEnvironment» :Virtual Machine Pricing Service Web Site Booking Service Booking Portal Bookings V3 Balance
  1. 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.
  2. 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.
  3. 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).
  4. 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.)
  5. 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.
The four stages at a glance
StageWhat changedBenefitsStill open afterwards
1V3-only functions added to V5; PCs run V5 as a thick client talking directly to the database, which stays on Developer A's serverNo 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/reportingThe database server still belongs to Developer A
2SQL Server database migrated to Amazon Web ServicesNo dependence on Developer A; better reliability; easy backend performance and redundancy options; lower maintenance costThe customer portal (online booking, profile)
3New Pricing Service (VM in AWS) replaces pricing in V5; new Web Site shows prices to customersStart of a service-based architecture; one shared location for services; transparency for customers; server optimisationOnline booking still missing
4New 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 beginsNot 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

Lesson 1

Listen, then analyse

The client's perspective is critical, but analysis is needed to get the full picture.
Lesson 2

Understand the business

Missing key elements, such as the workflow or the interface requirements, can make a system unusable.
Lesson 3

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.
Using the case in Q6

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.)

In short
  • 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.
8.12

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.

Q6.1 mistakes
  • 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.
Q6.2 mistakes
  • 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

UI SaleWindow+calculateTax() Domain Sale-window: SaleWindow Technical Services MySQL database (as the bottom "layer") 1 2 3 4 5 Find five errors beforereading the list below.
A diagram that loses marks. Each badge marks one error; the list below explains them.
  1. Solid line used for a dependency. Package dependencies are dashed lines with an open arrowhead.
  2. Upward dependency: Domain depends on UI. Coupling goes downward; if the domain must notify the UI, use Observer through an interface.
  3. A cycle between Domain and Technical Services. No cycles: factor out the shared types, or depend on an interface in a new package.
  4. 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.
  5. Model-View Separation broken twice: the domain's Sale references a concrete window, and the window holds application logic (calculateTax). Use a Controller going down and an Observer coming up.
More layer mistakes
  • 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 The significant decisions about structuralelements, interfaces, collaboration,composition (+ style). Hard to change, soanalyse early and record the rationale. Logical (packages) ≠ deployment (nodes). Architectural analysis Identify factors, understand variabilityand priority, resolve; NFRs in thecontext of FRs. Matters because: fewermissed factors · focus · business goals. Step 1 factor table → Step 2 memos. Significance and priority WIDEST: Wide · Inflexible · Difficult ·External · Shifting · Trade-offs.Variation point = now; evolution = later.Priority: legal/safety → business → other. Security = F; configurability = S. Scenario and factor table <stimulus> <measurable response> +environment; testable, no vague words.Columns: Factor · Measures & scenarios ·Variability (now + evolution) · Impact ·Priority · Difficulty/risk. Technical memo Issue + summary, then Factors · Solution ·Motivation · Unresolved · Alternatives.Solution = layers + subsystem + Facade /Adapter + Factory. Every alternativegets a rejection reason. Resolving factors LC, HC, PV at large scale; bind late.Cross-cutting: subsystem + Facade ·decorator/container · AOP.Pick your battles: defer if changinglater costs only a few person-weeks. Layers UI · Application · Domain · BusinessInfrastructure · Technical Services ·Foundation; coupling goes down.Relaxed = IS norm; strict = protocols.Partitions horizontal; tiers usually nodes. Connecting layers SSD system operations = UI → domaincalls, received by a Controller. Facadeinto subsystems; Observer (or UIFacade) up.MVS: no domain → UI coupling (exceptvia interfaces), no logic in the UI. Notation Package: tabbed folder; dashed openarrow to the depended-on; nesting byembedding, A::B or circle-cross; «subsystem».No databases as layers. Component:ball = provided, socket = required.
Part VIII on one page. Blue: what architecture and its analysis are. Gold: the artefacts Q6 asks you to produce. Violet: the structures and notation that fill the memo's Solution box.
In short: the whole Part
  • 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.