Yesod Web Framework
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
The content has been bookmarked!
There was an error bookmarking this content! Please retry.
Posted by Srini Penchikala on Nov 27, 2008
Documenting application architecture is an important part of the software development process. Paulo Merson recently talked about the role of documenting architecture in managing the Reference Architecture (RA). He did a presentation at SD Best Practices Conference on what information about an architecture should be captured and how UML 2.0, BPMN and other modeling notations and guidelines can be used for architecture representation.
The task of documenting the application architecture helps the architects and developers to evaluate the architecture and use it to guide the implementation (design and code).
Architecture can be described using Views (also known as Viewpoints or Perspectives) which are the representation of a set of system elements and the relations associated with them. A view constrains the types of elements and the types of relations that can be represented in that view. An architect can consider the system in a Multi-View Architecture based on:
Module Views:
These views show the structure of the system in terms of units of implementation (modules and the relations among these modules. Module Views act as the blueprints for the code. They can be used for budgeting, work assignment and tracking, and modifiability and impact analysis purposes. They are also useful for the education of new developers.
Runtime Views:
Also known as component-and-connector views, they show the structure of the system when it's executing. These views include elements like components that have runtime presence (e.g., processes, threads, EJBs, Servlets, DLLs, objects, ASP.NET components), data stores, and complex connectors (e.g., queues, pipes). They also show the interaction mechanisms, which vary based on technology, but should at least distinguish local from remote calls and synchronous from asynchronous invocation. Runtime Views show how components interact at runtime, what components are replicated, and what components access data stores. They can also be used for the analysis of runtime properties such as performance, security, and reliability.
Deployment Views:
These views are typically used to describe the hardware infrastructure of the production environment and the structure of directories and files of the deployed system. Deployment Views are useful for defining deployment and operation procedures (like "automatic updates" feature), auditing runtime failures and planning purchasing options.
Data Model:
It shows the structure of the data repository which includes data entities (persisted domain elements) and the relationships between these entities. Data models can be used as a blueprint for the physical database and are a useful reference for developers of data access code. They can also be used to assess performance in data-centric systems by analyzing the data elements like indexes and locks, SQL optimization, modifiability impact analysis, and input to normalization activity.
Paulo also stressed the importance of documenting behavior of the system. Behavioral documentation complements structural diagrams. He talked about the modeling notations used in UML diagrams such as Sequence, Communication (formerly called Collaboration diagrams in UML 1.x), Activity, and State Machine diagrams (formerly called Statechart diagrams). There are other notations like BPMN can be used to document the behavior of the system.
He discussed a template for documenting the software architecture views:
Paulo suggested the outline of a Software Architecture Document should include the following sections:
The document should include a Glossary and Acronym List in the document. Paulo showed some example model diagrams he created for Duke's Bank application and other design diagrams from real systems.
Concluding the talk, he discussed other important aspects of documenting the application architecture like the stakeholders' needs, reference architectures, and document variability in product line architectures (PLA). Paulo also said that other efforts like refining and refactoring the architecture as well as some type of architecture enforcement during software development and implementation phases are important to a successful architecture.
InfoQ spoke with Paulo about the current state and future direction of documenting software architecture.
How do UML Profiles and Stereotypes help in the efforts of documenting software architecture?
UML was initially created for modeling OO systems. It's now used for modeling any kind of software system. That means it's generic and hence has to be very flexible. UML stereotypes are a UML extension mechanism that allow assigning specific meaning to UML symbols. The stereotypes allow you to create more expressive diagrams. Let's say you have a (generic UML) connector in a diagram. If you know that connector is actually a JMS queue, you can stereotype the connector as <<JMS queue>>. You can put a set of stereotypes that make sense together in a UML profile. The UML specification has as an annex a profile for Java EE, a profile for .NET and a few others. It's a good idea to reuse or create your own stereotypes and profiles.
With several software development teams using Agile methodologies now-a-days, what can the software architects do to be Agile and pragmatic in documenting the application architectures?
It is a well known misconception that agile development means no documentation. In fact, as a survey shows, agile teams are more likely to model than traditional teams. A few things that agile architects (or perhaps any software architect) should remember:
The key aspect of design/modeling in agile projects is not to avoid designing, but to avoid "big-design up-front" (BDUF). In general, high-level architectural strategies should be worked out up front, but many design decisions and design details can be left to when you need them.
Only produce design documentation that will fulfill a need of the stakeholders. Stop designing as soon as you're ready to start coding. In the next sprint you can expand/refine the existing design as needed in order to capture design decisions required by next sprint's features.
If it's not worth updating the design, throw it away. Some design diagrams are used to guide implementation, but at the end the code sometimes looks different from the diagram. If you don't have time to update the diagram to reflect the implementation, it's better to remove it than keeping an out-of-date diagram that may confuse a future reader.
Many times, sketches are all you need. Don't spend too much time crafting the neatest diagram using the latest and richest notation available. Don't spend too much money on sophisticated modeling tools if you just need a drawing tool. In many agile projects, especially the ones with small, co-located teams, the true value of design diagrams comes from drawing them, which forces you to think through the issues; once the issues are solved, the diagrams lose much of their value. Many times the design is represented as a sketch on a whiteboard or piece of paper. If the sketch can be used to successfully convey the design to the team, that sketch, as is, can be *the* diagram your architecture view. Why not?
Is there anything special in documenting the architecture of an SOA system?
SOA typically involves many design decisions (SOAP vs REST, ESB or direct point-to-point, service granularity, use a directory or not, use BPEL or not, SSL or message-level security, and many more). Each design decision has multiple alternatives. So it's important to understand and record the rationale for the choices you make. There are other considerations in Section 3.3 of a report we wrote last year called "Evaluating a Service-Oriented Architecture".
What do you see as the future of Software Architecture Documentation?
The software architecture discipline is far from maturity. There are great software architects out there creating ingenious solutions every day, but they work in different ways, they create different artifacts and use different notations for diagrams. A vision I like for the future is that new architects learn the craft at school rather than try-and-error in the battlefield. Part of this education is proper ways to represent the software architecture for other people's consumption. Important initiatives in the direction of good software architecture education are: the work of Grady Booch on the handbook of software architecture and the publications and curriculum developed at the SEI.
What do you recommend to the architects as the best practices and "gotchas" in the area of documenting Software Architectures?
- Document the architecture in multiple views.
- Always have a notation key for your diagrams.
- If you're using a design/architectural pattern, let the reader know.
- Follow a template.
- Only create documentation that will be useful to some stakeholders.
- Documentation doesn't mean paper or Word documents. Think wikis for example.
- Record the rationale for important design decisions.
- Review what you create.
Srini Penchikala currently works as Security Architect and has 17 yrs of experience in software product management.
In this ever changing world of technologies, this short article does a great job. I especially like the part where the author asserts we don't need sophisticated tools.Don't spend too much money on sophisticated modeling tools if you just need a drawing tool
Would be nice if we could see some templates, even just for the Duke Banking application
We're working on a complete example of software architecture document (in wiki format):
wiki.sei.cmu.edu/sad/
There you find also a template for architecture view and a template for interface specification.
Michael Snoyman presents Yesod, a web framework written in Haskell and containing a web server, templating, ORM, libraries (templating, gravatar, etc.).
Richard Kreuter and Kyle Banker on how to avoid classical RDBMS transactional systems by using compensation mechanisms, transactional messaging or transactional procedures.
Attila Szegedi talks about performance tuning Java and Scala programs at Twitter: how to approach GC problems, the importance of asynchronous I/O, when to use MySQL/Cassandra/Redis, and much more.
One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.
InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.
Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.
John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.
Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.
2 comments
Watch Thread Reply