52
Lecture 02 Architecture

L02 Architecture

Embed Size (px)

DESCRIPTION

Hugtakið hugbúnaðararkítektúr er yfirhlaðið orð og þýðir mismunandi hluti fyrir mismunandi fólk. Við ætlum í þessum fyrirlestri að skilgreina ýmis hugtök tengd arkítektúr til að fá betri skilning á þessu. Við munum einnig skilgreina hvað agile arkítektúr þýðir eða hvað það þýðir ekki. Þá skoðum við monolith arkítektúr sem er hinn hefðbundi arkítektúr sem flestir nota í dag. Vandinn er sá að í dag eru kröfurnar meiri en þessi arkítektúr ræður við og því hafa menn verið að skoða aðrar leiðir eins og lightweight Service Oriented Architecture og hvernig smíða má hugbúnað sem þjónustur eða microapps eða microservice. Við skoðum einnig lagskiptingu en það er elsta trikkið í bókinni og byggir á deila og drottna aðferðinni.

Citation preview

  • 1. Lecture 02Architecture

2. Agenda Building blocks (recap) Architecture Monolithic Architecture Service Oriented Architecture Layering 3. Reading Brown 1, 2, 3 og 4 Pattern: Monolithic Architecture Decomposing applications for scalability anddeployability The Scale Cube 4. Building Blocks 5. Building Enterprise Applications Building computer systems is hardDesignPatternArchitectureMiddlewareFrameworksOOProgramming 6. Architecture Shared understanding of systems design by the expertdevelopers on a project Highest-level breakdown of a system into its parts Decisions that are hard to change Architecture influences designof components, technology,performance and middleware There are always options 7. Object Oriented Programming OO is key to development of systems Design for reusability, flexibility and performanceOO design is more important than specific technologies, such as J2EE. Weshould try to avoid letting our technology choices, such as J2EE, constrainour ability to use true OO design Rod Johnson If the design is good, there is no code Jnas r, Senior Betware developer One of the biggest hurdles for developers Each component should be simple with simple task Involves understanding of interaction of parts 8. Design Patterns Design using known ideas Design patterns are standard solutions to common problemsin software design Systematic approach for problems that reoccur in softwaredevelopment Patterns have name and definitions - not language dependant History Landmark book from 1995: Design Patterns: Elements ofReusable Object-Oriented Software Gang of Four (GoF) 9. Middleware Enterprise system are built on middleware Can cover a broad spectrum of software and generally sitsbetween an application and an operating system For example, databases, application servers, web servers,messaging systems, transaction monitors The plumbing the infrastructure Horizontal market Solves common problems not specific business requirements Low-level system 10. Frameworks Frameworks define the support structure for how toorganize and build systems Can improve productivity We can use existing frameworks or build our own Frameworks implement common problems Developers extend and add their business requirements Framework design Use inheritance, inversion of control, interfaces and helperclasses Implement design patterns 11. QUIZWhich of the following statement is not true?A) Design patterns are solutions to common problemsB) Object oriented programing is good for general problemsC) Frameworks are used to increase productivityD) Middleware can solve business related problems 12. QUIZWhich of the following statement is not true?A) Design patterns are solutions to common problemsB) Object oriented programing is good for general problemsC) Frameworks are used to increase productivityD) Middleware can solve business related problems 13. Architecture 14. Architecture Means different things to different people Big picture,things difficult to change, a plan,a blueprint 15. Architecture nounThe decomposition of aproduct into a collection ofcomponents/modules andinteractionsStructure 16. Architecture verbUnderstanding what youneed to build, create avision and making the rightdecisionsVision 17. Types of Architecture There are many different architectures Network, security, data, hardware, enterprise All have structure and vision All have multiple constraints such as cost, time, legal, regulatory 18. Application Architecture Application is the focus Contains classes, components, design patterns, frameworks,libraries Lower-level aspects of software design Concerned with sign technology stack and layeringClientREST ServicesEJB3HibernateOracleClientREST layerService layerDomain LayerDatabase layer 19. System Architecture Focus on multiple applications across a number of tiersand technologies Interactions between applications Overall structure of the end-to-end software system athigh-level Mix of software and hardware 20. Software Architecture The combination of application and system architecture Includes the technical practices to build the software Design Principles, Programming languageDesign patterns, Unit testingand much more Must also include aspects like Cross-cutting concerns such as logging and exception handlingSecurity, Performance, Audit Requirements, constraints,and much more 21. Enterprise Architecture How the enterprise is broken up in groups/departments Business processes used Workflows used May not look at technology in detail rather how to ustechnology across the organization to get work done 22. Agile Architecture Agile refers to a methodology of building software moving fast, embracing change, release often, feedback cyclesetc.Does agile development team then build agilearchitectures? Agile architecture means it can react to change, is easyto change, is extendable 23. Agility Agility means you can use the OODA loopObserve, Orient, Decide and ActHow Spotify builds products 24. QUIZWhich of the following architecture descriptions would be concerned withinteractions between applicationsA) Application ArchitectureB) System ArchitectureC) Software ArchitectureD) Enterprise Architecture 25. QUIZWhich of the following architecture descriptions would be concerned withinteractions between applicationsA) Application ArchitectureB) System ArchitectureC) Software ArchitectureD) Enterprise Architecture 26. Monolithic Architecture 27. Monolith Architecture Traditional approach to building applications Chris Richardson: Decomposing applications forscalability and deployability 28. Monolith ArchitectureBookstore UIAccounting servicePayment serviceShipping service SQLBrowser Apache 29. Monolith Architecture Benefits Simple to understand Straightforward to develop and test One release and deployment All linking is a compile type Scaling is simple 30. Monolithic Architecture Drawbacks User interface challenge old style UI architecture Real-time applications (like node.js) dont fit in easy Obstacle to frequent deployment fear of change Overloads your IDE and container slow build, development Obstacle to scaling development teams Locks down the technology stack long term commitment 31. Service Oriented Architecture 32. SOA Overload term Means different things to different people Implies Web Services using SOAPSOA actually means that components of anapplication act as interoperable services, andcan be used independently and recombined intoother applicationsEngineering Software as a Serviceby David Patterson and Armando Fox 33. Service Oriented Architecture Software Architecture where all components aredesigned to be services Applications composed of interoperable services Easy to build new services Easy to change Parts of the systems need to change more than others 34. Traditional ArchitectureBookstore UIAccounting servicePayment serviceShipping service SQLBrowser Apache 35. SOA ArchitectureBookstoreServiceAccountservicePaymentserviceBookstore UIShippingserviceAPI 36. Partitioning the Monolith into Services One way is to go from Object soup to Services alongdomain seams to microservicesFrom http://www.manning.com/rotem/SOAp_SampleCh01.pdf Arnon Rotem-Gal-Oz SOA Patterns figure 1. 37. Microservices or microapps Each service can be around 100-200 LOC (lines of code) Size not the deterministic factor Single Responsibility Principle Dont fix it rewrite it Microservice can have embedded web server Totally independent 38. The Scale Cube 39. QUIZWhich statement is not true about SOA?A) SOA does not affect performanceB) No service can access other service data except using APIsC) SOA improves productivity though reuseD) Monoliths system must deploy all components 40. QUIZWhich statement is not true about SOA?A) SOA does not affect performanceB) No service can access other service data except using APIsC) SOA improves productivity though reuseD) Monoliths system must deploy all components 41. Bezos Mandate (from Yegges Rant)1. All teams will henceforth expose their data andfunctionality through service interfaces2. Teams must communicate with each other throughthese interfaces3. There will be no other form of interprocesscommunication allowed 42. Bezos Mandate (from Yegges Rant)4. It doesn't matter what technology they use5. All service interfaces, without exception, must bedesigned from the ground up to be externalizable. Noexceptions.6. Anyone who doesn't do this will be fired. 43. Layering 44. Layering Software systems can get complicated Abstractions are needed Layering provides abstraction by separating computersystems in layers Higher layers use services fromlower layers Each layer has dedicated tasksand hides complexity from upperlayers 45. Benefits of Layering You can understand a single layer as a coherent wholewithout knowing much about other layers You can substitute layers with alternativeimplementation of the same basic service You minimize dependencies between layers Layers make good places for standardization Once you have a layer built, you can use it for manyhigher-level services 46. Downsides Layers encapsulate some, but not all, things well Cascading changes For example adding a field in the UI requires changes on eachlayer Extra layers can harm performance At every layer things typically need to be transformed from onepresentation to another 47. The Three Layers Presentation Users interface to the system User can be another system Accepts input, displays views Domain The Application of the system The Business logic Tends to creep into presentation and data source Data Source Connection to the database Also Persistence 48. Summary Building blocks can help you Architecture comes in many forms Application, System, Software, Enterprise Monolithic Architecture Traditional approach, but getting difficult to scale Service Oriented Architecture Lightweight SOA, microservices Layering The oldest trick in the book