• Nie Znaleziono Wyników

Information systems modelling– UML and

N/A
N/A
Protected

Academic year: 2021

Share "Information systems modelling– UML and"

Copied!
67
0
0

Pełen tekst

(1)

Internet Engineering

Tomasz Babczyński, Zofia Kruczkiewicz Tomasz Kubik

Information systems modelling– UML and

service description languages

(2)

I. Design patterns used to build the Integration Tier

D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

1. The definition of the Integration Tier – a five- tiered model of logical separation of tasks

2. Basic Integration Tier design issues

3. Bad practices when designing the Integration Tier

4. Analysis of basic design issues

(3)

Design patterns used to build the Integration Tier

D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

1. The definition of the Integration Tier – a five-

tiered model of logical separation of tasks

(4)

Multitiered Information System

by D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

Client Tier

Customer applications, applets, elements of the graphical user interface

Presentation Tier

JSP Pages, servlets, and other user interface elements

Business Tier

EJB components and other business objects

Integration Tier

JMS, JDBC, connectors and connections with external systems

Resource Tier

Databases, external systems and other resources

Interacting with the user, device and user interface

presentation

Login, session management, content creation and delivery,

formatting and validation Business logic, transactions,

data and services

Resource adapters, external systems, mechanisms for

resource, control flow Resources, data and external

services

(5)

EIS (Enterprise Information System ) Tier

(Tutorial Java EE 5)

Business Tier Application Client

And Optional JavaBeans Components

Web Browser, Web Pages, Applets, and Optional JavaBeans Components

Client Tier

Java EE Server

EIS Tier Database and

Legacy Systems Java Persistence Entities Session Beans

Message-Driven Beans

Web Tier Web Pages

Servlets JavaBeens

Components (Optional)

(6)

Design patterns used to build the Integration Tier

D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

1. The definition of the Integration Tier – a five- tiered model of logical separation of tasks

2. Basic Integration Tier design issues

(7)

Basic issues of Integration Tier design

1. Managing access to data

2. Managing connections to a database - the pool calls

(8)

Managing access to data (1)

• Data access code is embedded in the Presentation Tier or Business Tier, which is used for other purposes such as:

– Servlet, EJB component

– As a result, these classes are occupied with additional

functions, performance and scalability. It would be better to

introduce the Integration Tier and place the code to access data there.

• Data access code is located in a tier of integration, but does not cache the results obtained during the various accesses to databases.

– If you need to increase scalability and improve performance, cache processing results in a database, avoiding duplication of operations directly at the database level.

(9)

Managing access to data (2)

• Data access code is extracted from the classes that are used to meet other objectives

• Data access code should be placed logically and physically closer to a data source

Any class

Code of Data Access

Client, Presentation

or Business Tier Resource Tier

Resource Tier

Data

Bases

Data Bases Any class

Code of Data Access

Client, Presentation or Business Tier

Integration Tier

(10)

Manage connections to a database - the pool calls

Connections returned to connection

pool

Client, Presentation

or Business Layer

Resource Layer DAO

DAO

DAO

Data Bases

Client, Presentation or

Business Layer Resource Layer

Data Bases

DAO

DAO

DAO

Used active connection Active

connections

Used active connection

Active connections

Database connections are not shared, which decreases

performance and scalability.

The pool of shared connections

improves performance and scalability

(11)

Results of experiments of access to database based on DAO, DAO and the pool of connections

and Domains Store design patterns

Requests

no. Jdbc[ms] Jndi[ms] Orm[ms]

lazy

20 8 431 5 136 2 627

100 49 356 19 311 2 445 Requests

no. Jdbc[ms] Jndi[ms] Orm[ms]

lazy

20 8 431 5 136 2 627

100 49 356 19 311 2 445 Requests

no. Jdbc[ms] Jndi[ms] Orm[ms]

lazy

20 8 431 5 136 2 627

100 49 356 19 311 2 445

Requests no.

Jdbc[ms]

(DAO)

Jndi[ms]

(DAO and pool of connections)

Orm[ms]

(Domain Store)

lazy

20 8 431 5 136 2 627

100 49 356 19 311 2 445

(12)

Design patterns used to build the Integration Tier

D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

1. The definition of the Integration Tier – a five- tiered model of logical separation of tasks

2. Basic Integration Tier design issues

3. Bad practices when designing the Integration

Tier

(13)

Bad practices

• Performing data validation

• Data structures from Presentation Tier are available

• Data structures from Business Tiers are available

• Sharing objects of an active connection to the database with the objects of the Presentation and Business Tiers

• Direct integration of exception handling in the tiers of the presentation and business

• To transmit data between Presentation and Business Tiers and the tier of integration is not used auxiliary object class

• No encryption of sensitive data

(14)

Design patterns used to build the Integration Tier

D.Alur, J.Crupi, D. Malks, Core J2EE. Desin Patterns

1. The definition of the Integration Tier – a five- tiered model of logical separation of tasks

2. Basic Integration Tier design issues

3. Bad practices when designing the Integration Tier

4. Analysis of Basic design issues

(15)

Design cases

1. Hiding data access logic in a separate tier

2. Separation of persistence mechanisms from the object model

3. Asynchronic calls of services

4. Facility of access to services by using the XML

Language and internet protocols

(16)

Problem 1 – Hiding data access logic in a separate tier.

Data Access Object

Client Tier

Servlets, JSP

Business Tier Client

Business Delegate

1

Data Base

Resource Tier Code of

Data Access

Integration Tier Presentation Tier

Servlets and JSP with presentation logic and controller to separate layers

Session Component with

business logic

Data Acces logic with direct accesss

to databases Session

Component

relational or object-oriented database, LDAP, file system,

repository XML

Architecture of information system

(17)

Requirements

• You need to implement data access mechanisms to retrieve and modify data in the permanent storage

• The persistent storage system should be separated from the rest of application - it does not disclose exceptions, data structures, objects related to types of sql libraries

• You should create an uniform interface to access data stored in various sources for example. in RDBMS, LDAP, OODB, XML

repository, flat file

• Data access logics should be organized and data access functions should be hidden in one location to achieve greater portability and ease of maintenance code

• It can be stateless

• It does not cache data obtained during data collection

(18)

Implementation

• Custom data access object

• Data Access Factory

• A collection of transfer objects

• Buffered collection of lines

• Collection of read-only

• lines Wrapper List (Wrapper Rowset List)

(19)

Result

• Hides data access

• Creates object-oriented mechanisms for data access and conceals of database schemas

• Facilitates data migration by replacing the DAO Tier

• Reduces the complexity of client code

• Introduces an additional tier

• Puts all the data access code inside a separate tier

• A design requires a hierarchy of classes

• Introduces complexity for the use of object-oriented data access methods

(20)

implements the CRUD operations

relational or object- oriented database, LDAP, file system,

repository XML result of a query

(21)

Download data

(22)

Insert data

(23)

Update data

(24)

Delete data

(25)

Problem 2 – The separation of persistence mechanisms from the object model. Domain Store

Possible solutions of persistence mechanisms

• No object model exists - a solution to the problem 1

• Persistence mechanism is implemented in containers, which are objects of "entity" (strategy-CMP Container-Managed

Persistence) - no inheritance in the object model

• Persistence mechanism is implemented at the premises of

"entity" (strategy BMP - Bean-Managed Persistence); code of persistence mixed with the object model (no inheritance)

• The mechanism of persistence is placed in the object model of

"entity" - code of persistence mixed with the object model

• The mechanism of persistence is separated from the object model of "entity" based on all object-oriented patterns

(26)

Model of Business Tier based on 2, 3, 5 solutions of persitsence

Client

Business logic Session Facade as

Session Facade

Transaction Logic managed by

Session Component, special components

or Container

Client or Presentation

Tier Business Tier

Component Entity A

Component Entity B

Component Entity C

(27)

Architecture of 5-tiered information system

Servlets, JSP Client

Entity

Component Business

Delegate 1 Data

Base Code of

Data Access Servlets and JSP with

presentation logic and controller to separate layers

Session Component with business logic, Entity Components as persistence transaction objects

Data Acces logic with JPA

accesss to databases Session

Component

Client Tier

Business Tier

Resource Tier Integration

Tier Presentation Tier

(28)

Requirements

Implementation of persistence mechanisms in business objects such as "entity " should be avoided

• It should be refrained from objects of type "entity" that use the persistence mechanisms of the container.

• The application can run in a web container.

Object models use inheritance and complex relationships.

• The mechanism of persistence can be realized in two ways:

– make your own skeleton of persistence

– or use a out-of-box solutions based on JDO or own O-R solutions,

(29)

Result

• Create custom implementation of persistence is a complex task

• Loading and saving multi-level tree of objects requires optimization

• Allows you to better understand the mechanisms of persistence principles

• Advanced mechanisms for persistence may be too powerful for a simple object model

• Facilitated testing of object model

• Separation of business object model from the persistence logic

Implementation

• Custom implementation of persistence

• Downloading of the on-demand

• JDO (Java Data Object)

(30)

Data model Business

Tier

(31)

Create and persist business object

(32)

Download data

(33)

Create and perform the Query

(34)

II. Example of multitiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization data by application

2.1. Structure of project

2.2. Business Service Subtier

2.3. Application Service of Business Tier 2.4. Integration Tier

2.5. Presentation Tier

(35)

Example of multitiered web application

1. Two examples of the architectures of the

multitiered application as the Visual Web Java

Server Pages applications

(36)

JavaServer Faces Standard Request-Response Life Cycle

(37)

Example of the architecture of web application based on synchronization data by databases (1)

ApplicationBean1 Application Service

Sun pattern

SessionBean1 Session Facade

Sun pattern

JSF Pages JSF Pages JSF Pages

Client1 Client2 Client3

Data base Library Directory

Object Model Gof Patterns:

Facade: TFacade Factory: TFactory Flyweight: TTitle_book

Integration Layer (EntityManager,…)

TopLink Gof and Sun Patterns:

Domain Store Transfer Object

Facade (XXXController) Factory

SessionBean1 Session Facade

Sun pattern

SessionBean1 Session Facade

Sun pattern Object Model

Gof Patterns:

Facade: TFacade Factory: TFactory Flyweight: TTitle_book

Integration Layer (EntityManager,…)

TopLink Gof and Sun Patterns:

Domain Store Transfer Object

Facade (XXXController) Factory

Object Model Gof Patterns:

Facade: TFacade Factory: TFactory Flyweight: TTitle_book

Integration Layer (EntityManager,…)

TopLink Gof and Sun Patterns:

Domain Store Transfer Object

Facade (XXXController) Factory

Resource Tier

Integration Tier

Business Tier

Presentation Tier

Client Tier

(38)

Architecture of web application based on synchronization data by databases (2)

• many clients of the Client Tier as the www pages

• many JSF pages of the Presentation Tier – each client has own pages

• many Session Facade Components of the Business Tier (SessionBean1) as remote facades of the Business Service

Subtier (Java Application project) based on the POJO objects – each client has own SessionBean1 and the own Business

Service Subtier

• own Domain Store Components of the Integration Tier

(39)

ApplicationBean1 Application Service

Sun pattern

SessionBean1 Session Facade

Sun pattern

JSF Page JSF Page JSF Page

Client1 Client2 Client3

Data Base Library Directory

Object Model Gof Patterns:

Facade: TFacade Factory: TFactory Flyweight: TTitle_book Integration Layer (EntityManager,…) TopLink

Gof and Sun Patterns:

Domain Store Transfer Object

Facade (XXXController) Factory

SessionBean1 Session Facade

Sun pattern

SessionBean1 Session Facade

Sun pattern

Resource Tier

Integration Tier

Business Tier

Presentation Tier

Client Tier

Example of the architecture of web application based on synchronization data by application (1)

(40)

Architecture of web application based on synchronization data by application (2)

• many clients of the Client Tier as the www pages

• many JSF pages of the Presentation Tier – each client has own pages

• common Application Service Component of the Business Tier (ApplicationBean1) as the remote facade of the Business

Service Subtier (Java Application project) based on the POJO objects – each client uses the common ApplicationBean1

• common Domain Store Components of the Integration Tier

(41)

Example of multiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization datas by application

2.1. Structure of project

(42)

Integration Tier:

Facades of Domain Store

Business Tier:

Business Service Subtier

as Application Service with Object model

Presentation Tier:

JSF pages

Business Tier:

Application Service

(43)

Presentation Tier

Business Tier:

Session Façade Application Service

(44)

Classes of

Presentation Tier Business Tier Integration Tier

(45)

Example of multitiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization datas by application

2.1. Structure of project

2.2. Business Service Subtier

(46)

Classes of

Business Service Subtier

(47)

Facade of

Business Service Subtier as POJO class (1):

business logic methods of subtier

(48)

Facade of

Business Service Subtier as POJO class (2):

business logic methods of subtier

(49)

Facade of

Business Service Subtier as POJO class (3):

summarization of business logic

(50)

Example of Entity class from Object Model of

Business Service Subtier (1):

Persistence Annotation

(51)

Example of Entity class from Object Model of

Business Service Subtier (2):

business logic methods

(52)

Example of multitiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization datas by application

2.1. Structure of project

2.2. Business Service Subtier

2.3. Application Service of Business Tier

(53)
(54)

binding data of JSF

Component remote method for methods of Business Service Subtier

(55)

Example of multitiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization datas by application

2.1. Structure of project

2.2. Business Service Subtier

2.3. Application Service of Business Tier 2.4. Integration Tier

(56)

Example of

Controller class as Facade of

Integration Tier

(57)

Tables generated from

Entities of Object Model of Business Service Subtier by Domain Store Components of Integration Tier

(58)

Example of multiered web application

1. Two examples of architectures of the multitiered application as the Visual Web Java Server Pages applications

2. The Visual Web Java Server Pages application based on synchronization datas by application

2.1. Structure of project

2.2. Business Service Subtier

2.3. Application Service of Business Tier 2.4. Integration Tier

2.5. Presentation Tier

(59)
(60)

Links to other pages of web application

(61)
(62)

addtitle_action

(63)

Method of event: the click of the addtitle button

Method of www response

(64)

Methods the FragmentBox Component as the subview of the Titles form view

(65)
(66)

storetitle_action

(67)

Method of event: the click of the storetitle button

Method of www response

Cytaty

Powiązane dokumenty

FC (final conditions) searching titles with the given value of a mandatory attribute ISBN or ISBN, and actor in the case of a cassette with the audio book, or information

FC (final conditions): It inserts a book consistent with the mandatory attribute ISBN, or ISBN and actor in the case of the audio book and the specified number of the book

Creation of connection from the Facade Session Bean of Library_EJB1-ejb module to the Client class of the Library_client-ejb project - right click the edytor window with Client

Creation of connection from the Facade Session Bean of Library1_EJB1-ejb module to the Client class of the Library1_client1-ejb project – expand the Source Packages node of

Add the access to the business classes of the Library2_JPA2 Java Application Project (SE type) in the Library2_EJB2-ejb Enterprise Application – right click the Libraries folder

The data stored in the database (titles) by Store data web page- at previous time they have been inserted by the Enterprise Application Client program. (TLibrary2_client_ejb) as

techniques based on design patterns used in the analysis, design and programming of information systems.. C2 Acquiring the ability to define and use model transformations C3

• Director objects receive the Builder abstract interface, that allows you to freely construct Product objects. • Separating the code used to construct Product objects from the