Transcript
Page 1: How I spend my money Software architecture course Mohan, Maxim

How I spend my money

Software architecture courseMohan, Maxim

Page 2: How I spend my money Software architecture course Mohan, Maxim

ArchitectureUI/PL

SQL Server

DBAL

Pipes and Filters

Events

Cascade Filters Intercepting Filters

AJAX

HTML, Javascript

AL/BL

JSP, Servlet;Business LogicTom Cat

DBL

Page 3: How I spend my money Software architecture course Mohan, Maxim

Architecture detailed

Page 4: How I spend my money Software architecture course Mohan, Maxim

Application architecture

Page 5: How I spend my money Software architecture course Mohan, Maxim

Deployment Architecture

Page 6: How I spend my money Software architecture course Mohan, Maxim

Use cases diagram

Register User

Login user

Create category

Create transaction

Change balance

Generate Report

Page 7: How I spend my money Software architecture course Mohan, Maxim

Design• 1. Intercepting FilterProblemHow do you implement common pre- and post-processing steps around Web page requests?

Page 8: How I spend my money Software architecture course Mohan, Maxim

Intercepting Filter

• When the Web server receives a page request, Request Handler passes control to the FilterChain object first. This object maintains a list of all filters and calls each filter in sequence. FilterChain can read the sequence of filters from a configuration file to achieve deployment-time composability. Each filter has the chance to modify the incoming request. For example, it can modify the URL or add header fields to be used by the application. After all filters have been executed, Request Handler passes control to the controller, which executes the application functionality.

Page 9: How I spend my money Software architecture course Mohan, Maxim

Intercepting filter implementation

Page 10: How I spend my money Software architecture course Mohan, Maxim

Design

• Composite filter

Page 11: How I spend my money Software architecture course Mohan, Maxim

Composite Pattern• Use a Composite pattern to design the filtering system and

provide explicit support for filter pipelines.• To implement the design of the Composite Filter, you will

need to design the filtering subsystem such that the filtering mechanism is encapsulated behind an interface and use the design structure of the Composite pattern to provide support for complex hierarchical and pipelined filters. The Composite pattern provides support for combining filters in a hierarchical fashion. Composite will allow you to model complex multilevel tree structure of filters but the explicit representation of pipelines is not visible in its design. Therefore, you will add first-class support for the pipeline roles in the design structure of Composite.

Page 12: How I spend my money Software architecture course Mohan, Maxim

Cascading Filter Pattern• Basic schema:

Filter

Filter Filter

Filter

Filter

Filter Filter

Filter

Filter

Filter

Pipe

Filtermanager

Page 13: How I spend my money Software architecture course Mohan, Maxim

Cascading Filter Pattern

• Sequence diagram

Page 14: How I spend my money Software architecture course Mohan, Maxim

Cascading Filter usage example

Page 15: How I spend my money Software architecture course Mohan, Maxim

Other patterns

• Façade : Database Access Layer

Page 16: How I spend my money Software architecture course Mohan, Maxim

Other patterns

Page 17: How I spend my money Software architecture course Mohan, Maxim

Other patterns

• Factory Method: Database Access Layer

Page 18: How I spend my money Software architecture course Mohan, Maxim

Other patterns

• Template method: part of the composite method.

Page 19: How I spend my money Software architecture course Mohan, Maxim

Other patterns• Predicate: filters customization

Page 20: How I spend my money Software architecture course Mohan, Maxim

JSP – Servlet Graph

Page 21: How I spend my money Software architecture course Mohan, Maxim

Filters UsedFilters List: Functional requirements:• Create user.• Create account.• Create withdraw account transaction.• Create deposit account transaction.• Create items transaction.• Create category.• Get transaction by date, account, and user.• Get items by date, name, and price.• Get items by category.• Create report.

Non-functional requirements:• Validate account number format.• Validate user name format.• Validate password format.• Validate category name format.• Validate transaction date format.• Validate item name format.• Validate item price format.• Check user name exists.• Insert user class instance into the session.• Check if user instance class is present in the session.• Log out.• Delete user from the session

Page 22: How I spend my money Software architecture course Mohan, Maxim

Filters usedCascading filters managers:• Login user

– Validate base user data• Validate user name format. (Ruled Validate field filter)• Validate password format. (Ruled Validate field filter)

– Get user (DB level).– Insert user class instance into the session.

• Create user.– Validate user data

• Validate base user data.• Validate confirm password format (Ruled Validate field filter)• Check password and confirm password for quality.

– Check user name exists.– Create user. (Business logic level, DB level).– Insert user class instance into the session.

• Get categories– Check if user instance class is present in the session. (Optional)– Get categories list (DB level). Generate categories report– Generate html report. Generate categories report

• Create category– Check if user instance class is present in the session.– Validate category name format. (Ruled Validate field filter)– Create category (Business logic level , DB level).– Get categories.

Page 23: How I spend my money Software architecture course Mohan, Maxim

Filters used• Create withdraw account transaction.

– Check if user instance class is present in the session.– Validate transaction date format. (Ruled Validate field filter)– Validate money amount format. (Ruled Validate field filter)– Create withdraw transaction. (Business logic level)– Perform transaction. (Business logic level , DB level)

• Create deposit account transaction– Check if user instance class is present in the session.– Validate money amount. (Ruled Validate field filter)– Create deposit transaction. (Business logic level)– Perform transaction. (Business logic level , DB level)

• Create items transaction– Check if user instance class is present in the session.– Validate transaction date format. (Ruled Validate field filter)– Create items.

• Create item.– Validate item name format. (Ruled Validate field filter)– Validate item price format. (Ruled Validate field filter)– Check category id exists.– Create item (Business logic level).

– Create transaction (Business logic level).– Perform transaction (DB logic level).

• Generate transaction report.– Check if user instance class is present in the session.– Validate transaction start date if exists. (Ruled Validate field filter)– Validate transaction end date if exists. (Ruled Validate field filter)– Get transaction (DB Level).– Generate html report.

• Get items by category report.– Check if user instance class is present in the session.– Get items by category (DB level).– Generate html report.

• Log out user.– Check if user instance class is present in the session.

• Delete user from the session

Page 24: How I spend my money Software architecture course Mohan, Maxim

Servlets – Filters mapping

Page 25: How I spend my money Software architecture course Mohan, Maxim

Subsystem design

Page 26: How I spend my money Software architecture course Mohan, Maxim

Business subsystem

Page 27: How I spend my money Software architecture course Mohan, Maxim

Business subsystem

Page 28: How I spend my money Software architecture course Mohan, Maxim

DBAccess Subsystem

Page 29: How I spend my money Software architecture course Mohan, Maxim

DBAccess Subsystem

Page 30: How I spend my money Software architecture course Mohan, Maxim

Filters Subsystem

Page 31: How I spend my money Software architecture course Mohan, Maxim

Filters Subsystem

Page 32: How I spend my money Software architecture course Mohan, Maxim

Onjava Subsystem

Page 33: How I spend my money Software architecture course Mohan, Maxim

Predicate subsystem


Top Related