Chapter 22: Documenting Architectures – Views & Behavior

0:00 / 0:00
Report an issue

Welcome to Last Minute Lecture.

This free chapter overview is designed to help students review and understand key concepts.

These summaries supplement not replaced the original textbook and may not be redistributed or resold.

For complete coverage, always consult the official text.

Welcome back to the Deep Dive.

Today, we're really digging into something fundamental, I think.

It's about making software that lasts, avoiding that messy collapse later on.

Yeah, we're talking about architectural documentation.

And the source material had this great line, maybe a bit cheesy, but true.

Documentation is a love letter that you write to your future self.

It really is.

It's about thinking ahead.

So today, we're looking at how to actually do that documentation for software architecture, not just drawing boxes,

but communicating the design,

clearly.

So everyone involved actually gets it.

Junior devs, CEO, whoever.

Right.

The main takeaway here is that documentation isn't something you tack on at the end.

Right.

It can't be an afterthought.

No.

Ideally, designing and documenting are, well, almost the same activity.

You capture the thinking as it happens, maybe using something like a wiki or shared space.

That makes sense.

It's like an external brain for the project.

Kind of, yeah.

It holds all those decisions about security, performance, how things connect.

I mean, who can remember all that stuff?

It saves the or really anyone from having to explain the why over and over again.

You know, I hadn't really thought about it this way, but it sounds like documentation is almost political.

It tells future teams what they have to do.

Prescriptive, yeah.

But it tells the current client what was done.

Descriptive.

Exactly.

It serves different roles for different people.

So let's break that down.

Who is using this stuff and why?

Okay.

So the source highlights four main uses.

First one's pretty straightforward.

Education.

Like onboarding new people.

Exactly.

New team members, maybe analysts coming in, even a new architect or the customer needs to get up to speed on the system's basics.

Okay.

Education.

What's next?

Communication.

This is where it becomes the main way stakeholders talk about the architecture.

And interestingly, one of the biggest users here is the future architect.

Which might just be you five years later wondering why on earth did I pick that protocol?

Precisely.

Happens all the time.

Okay.

Third use.

Analysis and construction.

This is more the nuts and bolts.

It's the blueprint for the developers tells them what modules to build, how they connect.

And critically, it's what you use to check if the design actually meets its goals, like performance targets, or how easy it is to change later.

Makes sense.

And the last one.

Forensics.

Ah, the middle of the night emergency call scenario.

You got it.

When something breaks, the documentation showing the as is architecture, well, it can save you hours, maybe days, of detective work, trying to figure out what went wrong where, especially with complex distributed systems.

Okay, so it sounds like good documentation is really about managing risk and ensuring things keep working, right?

Whether you're building it or fixing it.

That's a good way to put it.

And to do that reliably, you need a clear language, a notation.

Right.

And the source talks about a lot of stuff.

Yeah, exactly.

At one end, you've got informal notations.

Think whiteboard drawings, quick PowerPoint sketches, basic box and line diagrams.

Easy to make, but.

But the meaning isn't precise.

It depends entirely on whoever is explaining it.

You can't really analyze it automatically.

Okay, so moving up a bit.

You get semi -formal notations.

This is where most tools live things like UML or SysML.

They give you standard shapes and rules so you get some consistency.

You can do basic checks.

But still not perfectly precise.

Not mathematically, no.

The semantics aren't fully defined in a way a computer can deeply analyze.

Which brings us to the top end.

Formal notations or ADL's architecture description languages.

Right.

These are mathematically precise.

They have strict semantics.

So you can do deep analysis, automated checks, maybe even simulations.

Yes, absolutely.

You could potentially stress test the architecture's logic before writing code.

Then why isn't everyone using them?

Sounds amazing.

Well, they're hard to create.

Really time consuming.

It's a trade -off, you know.

Yeah.

Speed versus that level of assurance.

Most projects land on semi -formal as a practical compromise.

Okay, so we know who needs it, why they need it, and the language we might use.

But architecture is complicated.

How do we structure the documentation itself?

Ah, that brings us to maybe the most important concept.

The view.

A view.

Okay, what is that exactly?

Think of it like this.

Architecture has many facets,

right?

Performance, security, code structure, deployment.

A view is a slice through that complexity.

It shows a specific set of elements and their relationships focused on one particular type of concern.

Like a layers view only shows layers.

Exactly.

Or a deployment view only shows hardware and processes.

It breaks the problem down into manageable pieces.

So the key principle is document the relevant views.

Yes.

And relevant is defined by your project goals and what your stakeholders actually care about or need to know.

And different views expose different things, right?

Especially those quality attributes we always talk about.

Absolutely.

If you're worried about maintainability, you need a module view showing the code structure.

If performance is critical, you need a deployment view to see where the bottlenecks might be.

And you have to decide if creating and maintaining each view is actually worth the effort.

Always.

Cost versus benefit.

Okay, let's get into the main types of views.

The source talks about three main structural categories.

That's right.

First up, module views.

Okay, module views, what are they showing us?

These show the static structure of the code, how it's organized.

The elements are things like classes, components,

layers, the implementation units.

And the connections are things like depends on or is part of.

Exactly.

Static relationships.

These views are essential for planning work, figuring out the impact of a change, explaining the code base.

They directly support things like modifiability, portability, and reuse.

But they often get out of date, don't they?

If you don't diligently track how the actual code relates back to the documented responsibilities.

That's the constant battle, yes.

Yeah.

And their big limitation is they tell you almost nothing about how the connector views or CNC views.

Now we're talking runtime.

Okay, so the elements here are different.

Totally different.

Elements are things that exist at runtime processes, services, data stores, objects, and the connectors aren't just lines.

They're pathways of interaction, like message cues, specific protocols, remote procedure calls.

So CNC views show how the system actually works, the interactions.

Yes.

You can trace how requests flow through the system.

They're vital for reasoning about runtime qualities, performance, availability, reliability, concurrency.

And you need to document properties like response time for a service or the bandwidth of a connection.

Definitely.

Expected reliability, latency, resource needs.

That's crucial CNC information.

A big mistake is thinking the module view covers this.

It doesn't.

Got it.

Static versus dynamic.

What's the third main structural view?

Allocation views.

These map the software elements, which could be modules or components, onto the environment.

The environment meaning?

Hardware, mostly.

Processors, servers, networks, disk storage.

But it can also mean other things, like mapping software modules to development teams.

That's the work assignment structure, a type of allocation view.

Oh, okay.

And the goal here is comparison.

Essentially, yes.

You compare what the software needs, like processing power, memory, maybe security levels, with what the environment provides.

It's how you make sure the system can actually be deployed and run effectively and safely where it's supposed to.

Makes sense.

So those are the big three structural views.

But sometimes you need something more specific.

Right.

The source also talks about quality views.

These are custom views tailored to really important system -wide concerns, often quality attributes.

Like a security view.

Exactly.

A security view wouldn't show everything, just the components involved in security, the secure communication channels, how threats are handled.

Or you might have a performance view showing traffic hotspots or critical latency paths.

So they let you focus deeply on one critical aspect that cuts across the whole system.

Precisely.

They prevent critical quality attributes from getting lost in the general complexity.

We also need to document behavior, right?

Not just structure.

Yes, definitely.

Especially for things like figuring out potential deadlocks, timing issues, resource contention.

And there are different ways to do Two main flavors.

First, trace -oriented notations.

These focus on specific scenarios or paths through the system.

Think use cases, which describe functional steps.

Or sequence diagrams, showing messages between components over time.

Yes, sequence diagrams are a classic example.

Activity diagrams, too.

They're like flow charts, but can show concurrent activities.

But they only show some paths.

What if you need the whole picture?

Then you need comprehensive notations, like state machine diagrams.

These aim to map out all possible states an element can be in, all the transitions between states, the events that trigger them, the conditions, the actions.

So much more exhaustive for analyzing all possible behaviors.

Correct.

More complex to create, but necessary sometimes.

Okay.

Structure, behavior, quality.

But you mentioned that love letter idea.

There's something missing, isn't there?

The why.

Ah, yes.

Documenting rationale.

This is critical.

Maybe the most critical piece that often gets skipped.

This is explaining why the design is the way it is.

Exactly.

Why this pattern was chosen.

Why that interface looks the way it does.

Why this component runs on that server.

Why alternatives were rejected.

So what should you record?

Key design decisions.

The reasoning behind them.

And any assumptions you made.

The source suggests a simple table structure.

Design decision, then rationale and assumptions.

Can you give an example?

Sure.

Maybe you chose a message queue for communication between two services.

The rationale might be supports asynchronous processing, improving availability under load.

And the assumption might be slight increase in latency is acceptable for this interaction.

And writing that down stops people from questioning it or changing it later without understanding the tradeoffs.

That's the hope.

It prevents wasting time re -arguing settled decisions, or worse, accidentally breaking a key quality attribute because you didn't understand the original reason for a design choice.

Okay.

Switching gears a bit to the practical side.

Different people need different parts of this documentation, right?

Developers versus testers.

Yeah, definitely.

Developers usually need the big picture,

then details about the parts they're working on.

Interfaces, data models, code locations, constraints.

So module, CNC, allocation views are key for them.

And testers, integrators.

They often need more of a black box view.

Interface specs are crucial.

How is it supposed to behave?

They use the views to plan testing, especially integration testing piece by piece.

Modules, CNC, allocation views are useful for them too, but for different reasons.

What about actually maintaining this documentation, especially with modern tools?

Well, using online tools like Wikis is great for collaboration and keeping things accessible, but you need control.

You need clear permissions on who can actually change the core architectural documents versus who could just comment or discuss.

Otherwise, it could become chaos.

And what about systems that change really fast, like with continuous deployment or dynamic service discovery?

Can documentation even keep up?

That's a huge challenge for these dynamic architectures.

Documenting every single state is impossible, pointless even.

So what's the solution?

Just give up.

No, you shift focus.

Instead of documenting the exact structure at any given moment, you document the invariance.

Meaning the things that must always be true no matter how the system rearranges itself.

Like all services must expose health check endpoints or communication between these zones must use this security protocol.

You also document the rules for how the architecture is allowed to change a variability guide.

Ah, so you're documenting the constraints and the rules of evolution rather than a static snapshot.

Exactly.

It becomes less about blueprinting a fixed structure and more about governing a dynamic system.

And underlying all of this, connecting design back to purpose is?

Traceability.

You need to be able to link your architectural decisions back to the requirements or business goals that prompted them.

We often call these ASRs architecturally significant requirements.

So you can prove the architecture actually addresses what it was supposed to address.

Right.

It ensures the architecture is fit for purpose.

If you can trace all ASRs to architectural elements and decisions, you're in good shape.

Okay.

Wow.

That was a lot, but really useful.

So wrapping up this deep dive.

Yeah.

The key takeaways seem to be know your audience, choose the right views for their needs, whether structural or quality focused use notation that fits the purpose and critically always record the rationale, the why behind your decisions.

That love letter needs the reasons, not just the facts.

Couldn't have said it better.

All right.

So here's a final thought for you, our listener to chew on, especially thinking about those dynamic systems.

Given how much modern systems change on the fly, dynamic discovery,

continuous updates,

how does shifting the focus to documenting constraints and invariants rather than static structures fundamentally change what it means to be an architect?

Are you less of a static designer and more of a maybe designer of rules and guidelines for evolution?

Something interesting to consider for your own work.

Definitely food for thought.

Thanks again for sharing the source material with us for this deep dive.

ⓘ This audio and summary are simplified educational interpretations and are not a substitute for the original text.

Chapter SummaryWhat this audio overview covers
Architectural documentation represents a foundational discipline in software development that enables clear communication across diverse teams including engineers, quality assurance professionals, project leadership, and subsequent maintainers while preserving the reasoning behind critical design decisions. Because software systems operate across multiple dimensions simultaneously, effective documentation employs specialized visual and textual representations called views, each isolating particular system aspects and their interrelationships to address specific concerns or quality objectives. Module Views capture the static organizational structure of implementation artifacts such as classes, packages, and architectural layers, providing essential blueprints for development activities and enabling analysis of how modifications propagate through the codebase. Component-and-Connector Views represent elements as they exist during execution and depict the interaction pathways between them, supporting reasoning about runtime qualities such as responsiveness, fault tolerance, and scalability. Allocation Views establish relationships between software artifacts and their deployment contexts, including computational resources, hardware infrastructure, and organizational units responsible for development and maintenance. Specialized quality-focused views can be synthesized by extracting relevant architectural information to address cross-cutting concerns such as security posture or performance characteristics. Complementing these structural representations, behavioral documentation employs temporal notations to illustrate how architectural elements orchestrate interactions over time, utilizing approaches ranging from sequence-based models that trace specific execution paths to comprehensive state machine representations that capture all possible operational scenarios. A mature architectural description incorporates supplementary elements including environmental context diagrams, terminology definitions, documentation of system variability and evolution mechanisms, explicit cross-references between different views, and comprehensive rationale documentation that articulates the justification for chosen solutions alongside analysis of trade-offs and rejected alternatives. Documentation can be expressed through informal sketches, standardized graphical languages like UML and SysML, or rigorous formal architecture description languages that enable machine-based verification. For continuously evolving systems, documentation strategy shifts toward capturing invariant properties and permissible modification patterns, frequently augmented by automatically generated interface specifications that maintain synchronization with implementation realities.

Using this chapter to study? Last Minute Lecture is free and student-run. If it helped, consider supporting the project.

Support LML ♥