Notes on architecture
-
Upload
joonas-lehtinen -
Category
Technology
-
view
1.132 -
download
0
description
Transcript of Notes on architecture
![Page 1: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/1.jpg)
Dr. Joonas Lehtinen Founder & CEO / Vaadin
Notes on Architecture
![Page 2: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/2.jpg)
Structure [only] when needed
![Page 3: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/3.jpg)
![Page 4: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/4.jpg)
![Page 5: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/5.jpg)
Nightmare
![Page 6: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/6.jpg)
Dream
![Page 7: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/7.jpg)
Last name
varchar: !LAST_NAME
![Page 8: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/8.jpg)
Over-designed architecture
Increases risks by making implementation complex
Tries to achieve fault-tolerance or scalability never needed
Prepares for expansion and changes that will never happen
Software architecture danger #1
![Page 9: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/9.jpg)
If you are not 100% sure that a
requirement is solid, choose a simpler
structure even when the requirement night
not be fulfilled
![Page 10: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/10.jpg)
All requirements having an impact on architecture must have clear metrics and goals
![Page 11: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/11.jpg)
Learn to estimate and communicate cost impacts to negotiate requirements
![Page 12: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/12.jpg)
Overgeneralization
![Page 13: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/13.jpg)
![Page 14: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/14.jpg)
![Page 15: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/15.jpg)
![Page 16: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/16.jpg)
Custo
miz
ation b
y P
rogra
mm
ing
Custo
miz
ation b
y C
onfiguring
Report(XSL)
ReportExample
Millstone Cards 2.0
CustomCard UI
External System
Custom Data-
Source
Settings(XML)
Theme(HTML, CSS, ...)
SQL DBWeb
Browser
External Reporting System
SettingsExample
ThemeExample
Card UIExample
System Integration Example
Data-Source
Example
Millstone Cards 2.0 Structure
![Page 17: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/17.jpg)
Over-generalization
Tries to overcome unknown requirements
Moves the unknown to layers where it should not be (UI or user)
Claims that your software can do thinks that you do not know
Software architecture danger #2
![Page 18: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/18.jpg)
Decoupling tries to reduce complexity by adding complexity
![Page 19: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/19.jpg)
![Page 20: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/20.jpg)
![Page 21: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/21.jpg)
![Page 22: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/22.jpg)
You are now prepared to change a meatball
do I really
need to change it?
![Page 23: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/23.jpg)
![Page 24: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/24.jpg)
De-coupling
Will make your system slower to build, but could make it easier to maintain
Can make your system harder to understand (more modules and interfaces)
Can make your system easier to understand (modules decoupled)
Two edged sword of software architecture
![Page 25: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/25.jpg)
Decouple only things that should be built
separately. !
Decouple for readability, not for potential change.
![Page 26: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/26.jpg)
For the love of Refactoring
![Page 27: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/27.jpg)
Refactoring is very cheap. Rewriting (working parts) is cheaper than you think. Cleaning up the mess late never happens. Keep your room tidy!
![Page 28: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/28.jpg)
#1 Choose a statically typed language or loose refactoring tooling support
![Page 29: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/29.jpg)
Start with the simplest possible architecture. !
When you realize you need to work around your own architecture to add features, or it is impossible to add new features, or you don't know how to model your new features on top of the architecture - refactor!
- Petter Holmström
![Page 30: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/30.jpg)
Art of naming
![Page 31: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/31.jpg)
![Page 32: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/32.jpg)
Naming
One of the hardest tasks
Critical for clarity
Takes a lot of time when done properly
Should be debated in code review
Sign of a good architecture
![Page 33: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/33.jpg)
Good name
Short
Documents the described thing
Unique (for project and domain)
Intuitive
Follows project style
![Page 34: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/34.jpg)
Design patterns are dynamite
![Page 35: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/35.jpg)
![Page 36: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/36.jpg)
design pattern is a general reusable solution to a commonly occurring problem within a given context [in software design]
![Page 37: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/37.jpg)
Powerful tool !
Never use when not 100% sure that needed !
Disastrous in inexperienced hands
![Page 38: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/38.jpg)
Experts trying to save your project after too many design patterns in wrong places
![Page 39: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/39.jpg)
UX and SA go hand in hand
![Page 40: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/40.jpg)
wireframes and interaction design
code
software architecture
Requirements
![Page 41: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/41.jpg)
![Page 42: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/42.jpg)
Performance is not an afterthought
![Page 43: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/43.jpg)
HOWTO not fail with performance
Define performance !• Customer
requirement • Performance goal
is a number • Performance has
a cost
Measure performance !• Benchmark
regularly • Start measuring
before app is built • React regressions
immediately
![Page 44: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/44.jpg)
![Page 45: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/45.jpg)
Architecture for a Library
![Page 46: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/46.jpg)
"Don't ever code anything which has public API. You will be sorry"
- Artur Signell
![Page 47: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/47.jpg)
Internal Architecture!+!
API
Public Architecture!+!
API
Your
libr
ary
Someone else's application
depends on
depends on
![Page 48: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/48.jpg)
2001
![Page 49: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/49.jpg)
UIComponent
MillstoneWeb Adapter
Applicationlogic
Web-browser
XHTMLHttp-req.
XMLState change
ChangeEvent
Data source
2003
![Page 50: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/50.jpg)
2013
![Page 51: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/51.jpg)
When you do not know how it should work, please do not hide it behind an abstraction
![Page 52: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/52.jpg)
Architect who is not a developer is not an architect
![Page 53: Notes on architecture](https://reader034.fdocuments.in/reader034/viewer/2022051312/546276bab4af9f711c8b47c1/html5/thumbnails/53.jpg)