how i spend my money software architecture course mohan, maxim

Post on 17-Jan-2016

223 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

How I spend my money

Software architecture courseMohan, 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

Architecture detailed

Application architecture

Deployment Architecture

Use cases diagram

Register User

Login user

Create category

Create transaction

Change balance

Generate Report

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

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.

Intercepting filter implementation

Design

• Composite filter

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.

Cascading Filter Pattern• Basic schema:

Filter

Filter Filter

Filter

Filter

Filter Filter

Filter

Filter

Filter

Pipe

Filtermanager

Cascading Filter Pattern

• Sequence diagram

Cascading Filter usage example

Other patterns

• Façade : Database Access Layer

Other patterns

Other patterns

• Factory Method: Database Access Layer

Other patterns

• Template method: part of the composite method.

Other patterns• Predicate: filters customization

JSP – Servlet Graph

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

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.

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

Servlets – Filters mapping

Subsystem design

Business subsystem

Business subsystem

DBAccess Subsystem

DBAccess Subsystem

Filters Subsystem

Filters Subsystem

Onjava Subsystem

Predicate subsystem

top related