Architecture In the SmallRichard BanksPrincipal Consultant, ReadifySydney & Virtual ALT.NET Groupshttp://richardsbraindump.blogspot.comrichard.banks@readify.nethttp://twitter.com/rbanks54
What Does an Architect do?
3 Fundamentals
Communicate the Vision
Explain how to “Get There”™
Lead the Way Technically
and Architecture Itself?
The Design & Structure
Underpins the Vision
Architecture is...
Simple, Right?
NSW Transit T-Card$370million10 years0 to show
Westpac Rebuild (1988)$156 million3 years0 to show
Not just big projects
Apps that can’t support 10 users
Apps that lose/corrupt data
Apps that are
So where does it go wrong?
Project Failure ReasonsArchitect Involvement Has Yellow Background
Unrealistic or unarticulated goals
Inaccurate estimates
Badly defined system requirements
Poor reporting of the project's status
Unmanaged risks
Poor communication among customers, developers, and users
Use of immature technology
Inability to handle the project's complexityand Over Complexificationisationing
Sloppydevelopment practices
Poor project management
Stakeholder politics
Commercial pressures
Another Issue...
Software Is Designed Top Down
Software is Built Bottom Up
[Serializable][AttributeUsage(AttributeTargets.Assembly | AttributeTargets.Class, AllowMultiple = false, Inherited = false)][MulticastAttributeUsage(MulticastTargets.Class, AllowMultiple = false)]publicclassNotifyPropertyChangedAttribute : CompoundAspect{publicintAspectPriority { get; set; }publicoverridevoidProvideAspects(object element, LaosReflectionAspectCollection collection){Typetype = (Type)element;collection.AddAspect(type, newPropertyChangedAspect { AspectPriority = AspectPriority });foreach (PropertyInfopropertyInfointype.GetProperties(BindingFlags.Public | BindingFlags.Instance)   .Where(pi => pi.GetGetMethod() != null && pi.GetSetMethod() != null))   {collection.AddAspect(propertyInfo.GetSetMethod(),newNotifyPropertyChangedAspect(propertyInfo.Name, propertyInfo.PropertyType,propertyInfo.DeclaringType)              { AspectPriority = AspectPriority });     }  }}
Design == WhatCode == How
There’s a Disconnect Here
It’s the Architect’s Problem
Solution:
Design & Architect codeat the Lowest Levels toSupport High Level design goals
Architecture in the Small
Deals with (at least) 3 Failure Causes
ComplexityTechnical RiskSloppy Practices
Where Architects Go Wrong
Stopping Short on Design
Believing Marketecture
Following Guidance without Thinking(P&P)
Inattention To Detail
N.I.H. Syndrome
Not (properly) Explaining Howthings should be done
Not Trying Out What They Expect Others To Do
a.k.a.One-Directional ArchitectureOnly doing Top Down Design
Remember:The only way to “Get There” is via code
ArchitectsMUST write code
If you code it you can explain it
(Dis)Prove the Marketecture
Ensure Guidance Makes Sense
Provide Examples Others Can Follow
Deal With Technical Risk
Find Problems You Overlooked
Example: AOP
Choice of MethodsIL WeavingInterceptorsRoll your own
Choice of ToolsEntLibIoC ContainerPostSharp...more
Impact on compile times
Impact on discoverability
Impact on debugging
Impact on runtime performance
Impact on developers
If you’ve never tried it...How will you prove it works?How will you show others?
Another Thing to Consider
Teams mimic their architect
Write Clean, Maintainable Code
Example Time
Worst Method?
CC: 81LOC: 282Coupling: 32
Complexity FAIL!
Lesson: Keep Code SimpleBut don’t be simplistic
Lesson: Small Methods Only20 Lines or Less
Lesson: Small Classes
Lesson: Loose Coupling
Lesson: Meaningful Names
Lesson: Use Domain Language
Lesson: Single Responsibility
Lesson: Discoverable API
Lesson: Single Level Of Abstraction
Lesson: Avoid the “Duh!”Experience: Captain Obvious comments indicate a poorly architected system
A Note on Unit Testing
Test Code == Production Code
Lesson: Name Tests Well
Lesson: Assert Something!
Lesson: Test Behaviour Not State
Lesson: Test Just One Behaviour
What About the *ilities
Usability: (Subjective)
Maintainability:Destroyed in the smallIncludes agility, flexibility, testability, etc
Scalability:Hampered by the small
Reliability:Brought down by the small
Extensibility:Stymied by the small
Securability:Foiled via the small
Performance:Stalled by the small
It all comes from what happens in the small
Recap
Architects Are Project Fail Points
Architects Need to Code
Prove The Design
Lead By Example
Follow Sound Practices
Simple but Not Simplistic Code
Communicate via Code(not just Diagrams)
And sweat the details!
Thank You!http://richardsbraindump.blogspot.comhttp://twitter.com/rbanks54richard.banks@readify.net

Architecture In The Small

Editor's Notes

  • #2 Introduction slide: this slide must be the first slide in every RDN deck. Update the following:Title of TalkPresenter NamePresenter Position