Software Architecture Design 6 CCS 3 SAD Dr

  • Slides: 41
Download presentation
Software Architecture & Design 6 CCS 3 SAD Dr Kevin Lano

Software Architecture & Design 6 CCS 3 SAD Dr Kevin Lano

Session 7: Enterprise Styles and Enterprise Integration February 21 st / 28 th, 2020

Session 7: Enterprise Styles and Enterprise Integration February 21 st / 28 th, 2020

Learning Outcomes At the end of this session you should be able to: –

Learning Outcomes At the end of this session you should be able to: – Explain fundamental enterprise architecture styles; – Apply these styles to. NET-based architecture models; and – Explain the need for and the basic concepts of enterprise integration architectures. 03/03/2016 3

Last Week • Application Servers –. NET with COM+ components, ASPs • But other

Last Week • Application Servers –. NET with COM+ components, ASPs • But other infrastructures work on the same principles – Enterprise services facilitating enterprise application development • Transactions, JIT, Object Pools, . . . 03/03/2016 4

Today • Conclude study of enterprise architectures – Important n-tiered enterprise styles (EIS patterns)

Today • Conclude study of enterprise architectures – Important n-tiered enterprise styles (EIS patterns) – Enterprise integration architectures Martin Fowler et al. : Patterns of Enterprise Application Architecture. Addison-Wesley, 2003. Deepak Alur et al. : Core J 2 EE Patterns. 2 nd edition, Prentice Hall, 2003. Adam Bien: Real World Java EE Patterns. 2012. 03/03/2016

p Enterprise styles PART I 03/03/2016 6

p Enterprise styles PART I 03/03/2016 6

Enterprise Styles – Overview • Just like ordinary styles, but – Components specific to

Enterprise Styles – Overview • Just like ordinary styles, but – Components specific to chosen application server • E. g. , UML 2 specialized for COM+ • Address concerns specific to enterprise systems – Typically based on n-tiered (3+-tiered) style – Combinations or configurations of services may have negative impact on performance, reliability, etc • Platform-specific constraints and semantics help avoid this 03/03/2016 7

Enterprise Styles • Styles for. . . – Maintaining separation of concerns between the

Enterprise Styles • Styles for. . . – Maintaining separation of concerns between the tiers. Eg. , 5 tier EIS architecture has 3 tiers + presentation & integration tiers: • Presentation tier manages UI logic, separate from business logic; integration tier manages details of communication with resource tier on behalf of business tier • This improves modularity, maintainability, testability – Ensuring efficiency of communication between tiers 03/03/2016 8

Some Examples • Presentation tier styles (patterns): – View helper – Front controller •

Some Examples • Presentation tier styles (patterns): – View helper – Front controller • Business logic tier styles (patterns): – Session façade – Data transfer object (aka Value Object) 03/03/2016 9

View Helper – Problem • Web-based time-tabling system – Different ASP views for lecturers

View Helper – Problem • Web-based time-tabling system – Different ASP views for lecturers and students – Each • Uses a COM+ component for authentication • Uses a COM+ component to access time-tabling information – Each view includes its own code to invoke authentication and then create a presentation Code repetition! 03/03/2016 10

View Helper – Problem (2) 03/03/2016 11

View Helper – Problem (2) 03/03/2016 11

View Helper – Problem (3) • Common system logic scattered over multiple. ASP views

View Helper – Problem (3) • Common system logic scattered over multiple. ASP views – Causes maintenance problems and bugs • Data access and presentation logic tangled in the ASPs – Difficult to develop and maintain – Presentation tier can change often! • Cannot separate roles – Software developer vs Web designer 03/03/2016 12

View Helper – Solution • Introduce intermediate view helper components – Implemented as ASPs

View Helper – Solution • Introduce intermediate view helper components – Implemented as ASPs • Store view’s intermediate data model • Serve as business data adapters – Pagelet ASPs • ASPs that are never directly called by end users, only by other ASPs – Componentize presentation logic for reuse – Multiple views may share same helper 03/03/2016 • Retrieve and adapt similar model state for presentation in multiple ways 13

View Helper – Solution Intermediate view helper ASP • Part of presentation tier •

View Helper – Solution Intermediate view helper ASP • Part of presentation tier • Encapsulates logic for authorized access to restricted information • Common to lecturer and student ASPs 03/03/2016 14

View Helper – Solutions • Alternative: – Use ‘bean’ classes in conventional programming language

View Helper – Solutions • Alternative: – Use ‘bean’ classes in conventional programming language to supply common services to presentation tier components. – Eg. : an email validator Validator. Bean. java used by both a Login. jsp and Signup. jsp – This approach is used if there is common logic which does not involve producing UI content 03/03/2016 15

Some Examples • Presentation tier styles: – View helper – Front controller • Business

Some Examples • Presentation tier styles: – View helper – Front controller • Business logic tier styles: – Session façade – Data transfer object (aka Value Object) 03/03/2016 16

Front Controller – Problem • On-line shop – Complex navigation structure between a number

Front Controller – Problem • On-line shop – Complex navigation structure between a number of different ASP pages – Navigation needs to change often depending on changing business requirements – All views share some behaviour • E. g. , logging of user progress through the shop 03/03/2016 17

Front Controller – Problem (2) Many users, calling a range of different ASPs handle

Front Controller – Problem (2) Many users, calling a range of different ASPs handle navigation between each other via hyperlinks 03/03/2016 18

Front Controller – Problem (3) • Problems – No centralized point for handling of

Front Controller – Problem (3) • Problems – No centralized point for handling of common functionality • Integration of system services, security, content retrieval, progress logging, etc. • E. g. , “The user should always be able to see the status of her shopping basket” – Navigation logic scattered across all views • Difficult to update global navigation structure and maintain consistency 03/03/2016 19

Front Controller – Solution • Controller component as initial point of contact for handling

Front Controller – Solution • Controller component as initial point of contact for handling any request – Chooses appropriate view – Handles errors – Manages selection of content creation strategies (e. g. , dependent on target device) – Globally manages navigation structure • Can reduce amount of scripts embedded in ASP views 03/03/2016 20

Front Controller – Solution (2) All users interact with ASPs through controller, which handles

Front Controller – Solution (2) All users interact with ASPs through controller, which handles appropriate navigation logic. Pages appear to navigate between each other, but the controller intercepts and maintains all navigation. The Controller acts like a Controller in MVC – controls selection of views 21

BREAK 03/03/2016 22

BREAK 03/03/2016 22

Some Examples • Presentation tier styles: – View helper – Front controller • Business

Some Examples • Presentation tier styles: – View helper – Front controller • Business logic tier styles: – Session façade – Data transfer object (aka Value Object) 03/03/2016 23

Session Facade – Problem • Complex presentation logic – Presentation-tier component requires access to

Session Facade – Problem • Complex presentation logic – Presentation-tier component requires access to multiple business objects • Combines information obtained through all of them Shopping. Cart 03/03/2016 31

Session Facade – Problem (2) • Tight coupling of presentation and businesslogic tier –

Session Facade – Problem (2) • Tight coupling of presentation and businesslogic tier – Presentation tier must implement complex business logic – Poor separation of concerns/modularity – Presentation tier becomes directly dependent on detailed implementation of business tier • High network load – Too many method invocations between client and server 03/03/2016 32

Session Facade – Solution • Use intermediate business-logic component – Called session façade (cf.

Session Facade – Solution • Use intermediate business-logic component – Called session façade (cf. Java EE ‘Session bean’) – Provides simplified interface to client – Manages business logic and interaction of different business objects (workflow) • Remember system components in Cheesman/Daniels approach of Wk 2? – Implement system steps of use cases 03/03/2016 33

Session Facade – Solution (2) Presentation Tier Session facade encapsulates purchasing logic for the

Session Facade – Solution (2) Presentation Tier Session facade encapsulates purchasing logic for the middle tier, providing a single point of communication to the presentation tier – interface for the business logic Business Logic Tier Shopping. Cart 34

Session Facade – Advantages • Separation of presentation and business-logic concerns – Centralization of

Session Facade – Advantages • Separation of presentation and business-logic concerns – Centralization of presentation tier/business tier interactions – Better manageability; greater ability to cope with changes • Reduction of network usage – Reduced number of components directly accessed over the network 03/03/2016 35

Some Examples • Presentation tier styles: – View helper – Front controller • Business

Some Examples • Presentation tier styles: – View helper – Front controller • Business logic tier styles: – Session façade – Data transfer object (aka Value Object) 03/03/2016 36

Data Transfer Object – Problem • Payment page – Presentation tier uses fine-grained interface

Data Transfer Object – Problem • Payment page – Presentation tier uses fine-grained interface to interact with business tier <<ASP>> Billing. Details. Page IBilling <<interface>> IBilling +set. Name(name : String) : void +set. Card. Number(number : String) : void +check. And. Charge() : boolean <<COM+>> Billing. System 03/03/2016 37

Data Transfer Object Problem (2) • Clients need to make multiple calls to get

Data Transfer Object Problem (2) • Clients need to make multiple calls to get job done – Calls transfer individual attribute values/data items – Increases network load – Key problem is latency • Sending large amount of data once is better than sending lots of small packets 03/03/2016 38

Data Transfer Object – Solution • Use Data Transfer Objects – Inter-tier interfaces become

Data Transfer Object – Solution • Use Data Transfer Objects – Inter-tier interfaces become more coarse grained • All information transferred in one request – Presentation tier can still interact with DTO in a fine-grained manner to read individual attributes • But locally! Also known as Value Object pattern (Java EE) 03/03/2016 39

Data Transfer Object Solution (2) <<ASP>> Billing. Details. Page IBilling <<COM+>> Billing. System Data

Data Transfer Object Solution (2) <<ASP>> Billing. Details. Page IBilling <<COM+>> Billing. System Data Transfer Object Interface was simplified <<interface>> IBilling +check. And. Charge(card. Details : Card. Detail) : boolean 03/03/2016 40

Using multiple styles • Styles can be naturally combined: Intercepting Filter Front Controller View

Using multiple styles • Styles can be naturally combined: Intercepting Filter Front Controller View MVC Session Facade Value Object View Helper 03/03/2016 41

Using multiple styles Presentation tier List. Account. jsp Create. Account. jsp Customer Bean Account.

Using multiple styles Presentation tier List. Account. jsp Create. Account. jsp Customer Bean Account. VO Business tier Customer. VO Dbi 03/03/2016 Create. Customer. jsp Integration tier 42

The biggest picture: enterprise integration PART II 03/03/2016 43

The biggest picture: enterprise integration PART II 03/03/2016 43

The Biggest Picture • Abstraction helps deal with bigger systems • We continuously increased

The Biggest Picture • Abstraction helps deal with bigger systems • We continuously increased abstraction: – Source code of programs – Software design (e. g. , with UML) – Software architecture (most of this module) • Enterprise Integration is most abstract architectural level 03/03/2016 44

Enterprise Integration Architectures • Enterprise applications do not exist in isolation – Connected to

Enterprise Integration Architectures • Enterprise applications do not exist in isolation – Connected to other applications and services • Data feeds • Common reference data • Elaborate integration networks • Enterprise Integration Architecture (EIA) shows this structure – Entire software portfolio of an enterprise (“software landscape”) • Collection of applications • Heterogeneous platforms • Islands of sometimes duplicated data • Services interconnected by messages, objects, file transfers, batch feeds, and human interactions 03/03/2016 45

Describing EIAs • Partially with UML 2 – Appropriately stereotyped components corresponding to entire

Describing EIAs • Partially with UML 2 – Appropriately stereotyped components corresponding to entire applications – Connectors representing interrelationships between applications • But not completely – Not always component-oriented (hierarchical) • Cross-cutting concerns – Human interaction – Process-based workflows instead of structural connection • Biztalk, Oracle workflow, TIBCO – workflow based technologies to aid integration • E. g. , web services and workflow engines 03/03/2016 46

Holiday Reservation Workflow Request Car Quotes 03/03/2016 Car Rental Service Book Car Hotel Booking

Holiday Reservation Workflow Request Car Quotes 03/03/2016 Car Rental Service Book Car Hotel Booking Service Request Hotel Quotes Choose Package Book Hotel Request Plane Quotes Holiday Package Calculator Book Plane Booking Service 47

Coming Up • Java Enterprise Edition • Mobile application architectures 03/03/2016 48

Coming Up • Java Enterprise Edition • Mobile application architectures 03/03/2016 48