250 likes | 317 Views
Software Architecture. Martin Nally. Who am I?. And why am I here?. What most software looks like inside. What is design?. 1 [countable ] a plan or drawing produced to show the look and function or workings of a building, garment, or other object before it is built or made.
E N D
Software Architecture Martin Nally
Who am I? And why am I here?
What is design? • 1[countable] a plan or drawing produced to show the look and function or workings of a building, garment, or other object before it is built or made. • 2 [uncountable, countable] the general arrangement of the different parts of something that is made, such as a building, book, machine, etc. • 3[uncountable, countable] the purpose, planning, or intention that exists or is thought to exist behind an action, fact, or material object. Most importantly, the design signifies the ideas that guide construction
What is architecture? • 1 [uncountable] the art and study of designing buildings • to study architecture • 2 [uncountable] the design or style of a building or buildings • the architecture of the eighteenth century • modern architecture • 3 [countable, uncountable] (computing) the design and structure of a computer system
What is the difference? “The design of a piece of software” vs “The architecture of the software” • The second is either: • A) The highest-level and most difficult to change aspects of design • B) A vulgar grammatical error commonly made by computer programmers (and increasingly others) You choose.
What to read • There is a lot out there, much of it bad • Here are two I like
What makes good design? • Parsimony • Clarity of structure • Consistency • “Blaauw and I believe that consistency underlies all principles. A good architecture is consistent in the sense that, given a partial knowledge of the system, one can predict the remainder” • Orthogonality • Propriety • Generality
But you can’t really get it from books • It takes a lot of practice. • Key elements: • strong organizing ideas • the relentless pursuit of simplicity and order. • The highest achievement is making it appear so clear and simple that people will think the problem wasn’t very hard or the solution very clever. • “Perfection is achieved not when there is nothing more to add but when there is nothing more to take away” – Antoine de Saint Exupery
Let’s look at an example • How do you integrate multiple applications into a single coherent system • A large web-site • An EAI (Enterprise application integration) system • A system of tools that support a development process
Requirements Tool Build Tool SCM Defect Tool Test Tool Build 2 Change 1 Change 2 Build 1 Data Data Data Data Data Reqt 1 Reqt 3 Reqt 2 Reqt 4 SOA Bug 1 Bug 2 Bug 3 Bug 4 Copy of Bug 2 Test 1 Test 3 Test 2 Copy of Test 2
Bug 1 Bug 3 Bug 4 Requirements Tool Build Tool SCM Defect Tool Test Tool Build 2 Change 1 Change 2 Build 1 Data Data Data Data Data Reqt 1 Reqt 3 Reqt 2 Reqt 4 Service Bus Test 1 Test 3
Requirements Tool Build Tool SCM Defect Tool Test Tool Build 2 Change 1 Change 2 Build 1 Reqt 1 Reqt 3 Reqt 2 Reqt 4 Central repository Query and reporting Test 3 Test 1 Bug 3 Bug 1 Bug 4
A new one - Linked data Defect Tool Defect ToolB Bug 2 Bug 4 Test 1 Bug 1 Bug 3 Test 4 Build Tool Test Tool Test 3 Build 1 Change 1 Test 2 Build 2 Change 2 Requirements Tool SCM Reqt 1 Reqt 4 SCM B Reqt 2 Reqt 3
What is Linked Data? (TBL) • Use URIs as names for things • Use HTTP URIs so that people can look up those names. • When someone looks up a URI, provide useful information, using the standards (RDF*, SPARQL) • Include links to other URIs. so that they can discover more things.
What is Linked Data? (MPN) • This world-wide web thing looks promising – I think it might catch on • Two main things power the web • The HTTP protocol provides a universal API • HTML provides a universal content language • We could do the same for data • The HTTP protocol (again) • RDF
How does this relate to REST? • It’s the same, except • Nobody really does REST – they just say they do • REST does not specify a data model • People use JSON, which lacks meaning
What is REST? • A post-hoc analysis of the design of the WWW, written up by Roy Fielding • “distributed hypermedia” • Client-Server • Stateless • Cache • Uniform Interface • Layered System • Code on demand
Doing violence to REST • Wunderground PWS upload protocol • Uses GET to ‘post’ new records !! • http://weatherstation.wunderground.com/weatherstation/updateweatherstation.php?ID=KCASANFR5&PASSWORD=XXXXXX&dateutc=2000-01-01+10%3A32%3A35&winddir=230&windspeedmph=12&windgustmph=12&tempf=70&rainin=0&baromin=29.1&dewptf=68.2&humidity=90&weather=&clouds=&softwaretype=vws%20versionxx&action=updateraw • Why?
What is wrong with this? • “REST APIs must be hypertext-driven” - Roy • “A REST API should spend almost all of its descriptive effort in defining the media type(s) used for representing resources and driving application state, or in defining extended relation names and/or hypertext-enabled mark-up for existing standard media types. Any effort spent describing what methods to use on what URIs of interest should be entirely defined within the scope of the processing rules for a media type (and, in most cases, already defined by existing media types). [Failure here implies that out-of-band information is driving interaction instead of hypertext.]” - Roy
But really – does it matter? • Playing fast and loose with ideas will have consequences • I was recently asked: “How can I verify the links in my API? • Answer: • If you wrote a swagger-style API, you will have to write special code • If you wrote a true REST API, any standard crawler will do. • “Crawlability” is a good test for several common REST mistakes
More REST violence - Docker • curl http://172.17.0.1/containers/json • curl –X POST –d ‘{“Image”: image_name}’ –H “Content-Type: application/json” http://172.17.0.1/containers?name=inst1
Do you really understand it? • 3 levels of understanding of math • I can use the formula to solve a problem • I can prove the formula • I see the big idea behind the proof • In programming (? – make up your own) • I can use the API • I can design an API • I see the big idea behind the design • I can tell you why all the other design options are inferior or infeasible