SE 18 Team 07 S
Name Student Number
Aye Thet Mon A0006361U
Ng Siew Leng A0065958L
Pragati A0065772X
Tin Lai Wai HT082204N
Varun Tak A0065741E
Zhang Shudong A0065913A
2
Agenda Recap
o Business Domaino Global Use Case Diagramo Architecture View of ECMS
Design Use Cases Development Important Features Technical Challenges Future Aspects and Improvements Doing It Again Management Highlights Q & A
3
Recap Project Sponsor
o WWW Cargo Pte Ltd
Project Background
o Daily business operation heavily relies on shared MS Excel files
Project Objective
o To develop ECMS system which will assist their daily business operation
Main Project Scope
o Customer/Agent Profile Management
o Customer Cargo Tracking Management
o Sea/Air Import Operation Processing
4
Login Logout
Maintain Self Account
User
List all Agent Profile
List all Customer Profile
Maintain Agent Branch ProfileMaintain Agent Profile
<<include>>
Maintain Customer Profile Maintain Supplier Profile
<<include>>
Search Agent Profile
Search Customer Profile
MarketingStaff
List all User Accounts
Maintain User Account
Reset User Password
<<extend>>
Search User Account
SystemAdminStaff
List all Shipment Tracking RecordsMaintain Customer Cargo Record
Maintain Shipment Tracking Record
Search Customer Cargo Record
Search Shipment Tracking Record
CustomerServiceStaff
List all Air Freight Job Records
Maintain Air Freight Job Record
Maintain Air Freight Sub-Job Record
Maintain Air Import Costing Sheet
Maintain Air Import Delivery Note
Search Air Job Record
Import Job Record
<<extend>>
Maintain Sea Freight Job Record
<<extend>>
Maintain Sea Freight Sub Job Record
<<extend>>
List all Sea Freight Job Records
Maintain HBL
Maintain MBL
Maintain Sea Console manifest
Maintain Sea Import Arrival Notice with charge
Maintain Sea Import Arrival Notice without charge
Maintain Sea Import Costing Sheet
Maintain Sea Import Delivery Note
Maintain Sea Import Trucking Instruction
Maintain Shipping Note
Maintain Transhipment Cover note
Search Sea Job RecordsGenerate Monthly Report
OperationStaff
<<extend>>
6
Recap A multi layer architecture powered by Spring
Framework, ExtJS, Spring Security and Hibernate. Taken advantage of Spring’s multi layer injection
and loose coupled approach of having an MVC architecture.
Rich UI achieved using ExtJS 4.0 Framework at UI layer.
Communication achieved using AJAX calls (XMLHttpRequest) from Client to Server using JSON objects.
7
: OperationStaff : OperationStaff : MaintainAirFreightJobRecordUIView : MaintainAirFreightJobRecordUIView : MaintainAirFreightJobRecordUIButton : MaintainAirFreightJobRecordUIButton : MaintainAirFreightJobRecordUIController
: MaintainAirFreightJobRecordUIController
: MaintainAirFreightJobRecordUIStore
: MaintainAirFreightJobRecordUIStore
: Proxy : Proxy : Service : Service
1: clickButton( )
2: handler( )
3: create( )
4: renderView( )
5: delegateAsyncRequest( )
6: delegateAsyncRequest( )
7: handleRequest( )
Service class becomes the actor for backend functions
Design Use Case #1 (UI Layer)Maintain Air Freight Job Records
11
: Service : Service : AirJobController : AirJobController
: AirJobService : AirJobService : HibernateT...
: HibernateT...
: JSON Array : JSON Array : JSON Object : JSON Object : AirJobDAO : AirJobDAO
: AirJob : AirJob
2: addJob( ) 3: getListAirJobFromJSON ( ):List<AirJob>
4: fromObject(Object):JSON Array
5: toCollection(JSON Array, AirJob)
8: getAirJobFromJSON ( ):AirJob
13: saveAirJob(AirJob)
14: saveAirJob( )
1: addJob( )
9: fromObject(Object):JSON Object
10: toBean(JSON Object, AirJob)
6: AirJob( )
7: setAttributes( )
11: AirJob( )
12: setAttributes( )
Design Use Case #1 (Service Layer)Maintain Air Freight Job Records (ADD)
12
: Service : Service : AirJobController : AirJobController : AirJobService : AirJobService : JSON Array : JSON Array : JSON Object : JSON Object : AirJobDAO : AirJobDAO
: AirJob : AirJob :
HibernateT... :
HibernateT...
1: updateJob( )
2: updateJob( )
3: getListAirJobFromJSON( ):List<AirJob>
4: fromObject(Object):JSON Array
5: toCollection(JSON Array, AirJob)
8: getAirJobFromJSON( ):AirJob
9: fromObject(Object):JSON Object
10: toBean(JSON Object, AirJob)
7: setAttributes( )
12: setAttributes( )
13: saveAirJob(AirJob)
14: saveAirJob( )
6: AirJob( )
11: AirJob( )
Design Use Case #1 (Service Layer) Maintain Air Freight Job Records
(Update)
13
: Service : Service : AirJobController : AirJobController : AirJobService : AirJobService : JSON Array : JSON Array : AirJobDAO : AirJobDAO
: AirJob : AirJob
: HibernateT...
: HibernateT...
1: deleteJob( )
2: deleteJob( )
3: getListIdFromJSON(Object):List<Integer>
5: toCollection(JSON Array, AirJob)
4: fromObject(Object):JSON Array
8: deleteAirJob(AirJob)9: loadAirJob(AirJob, Integer)
10: deleteAirJob( )
6: AirJob( )
7: setAttributes( )
Design Use Case #1 (Service Layer) Maintain Air Freight Job Records
(Remove)
14
: Service : Service : AirJobController : AirJobController : AirJobService : AirJobService : AirJobDAO : AirJobDAO :
HibernateT... :
HibernateT... : HashMap : HashMap
1: listJob ( ):list<AirJob>
2: getJobList( ):list<AirJob>
3: getAllAirJobs( ):list<AirJob>
4: findAirJobList( ):list<AirJob>
5: getMap(list<AirJob>):HashMap(key,value)
6: put(String, Long)
7: put(String, list<AirJob> )
Design Use Case #1 (Service Layer) Maintain Air Freight Job Records (List)
15
Development Approach
A reference model developed for an important use case (Air Job) including UI widgets, controllers, services and DAOs.
After full requirement analysis Entities and DAO layer interfaces are finalized, and implemented.
Individual was assigned use cases to construct both UI components and Service components.
17
Flow of Development Activities
RequirementGathering, UI Prototype
andAnalysis
Experimental Reference application
development
Design andDevelopmentOf Use Cases
Entity and DAO
Implementation
Improvement And updates in Reference App
ContinuousIntegration and
Test
18
Development ActivitiesRequirement Analysis
Experimental Development of Reference Application
Entity Model & DAO Construction
Design, Development & testing of Use Cases
Improvement and Add-On
Continuous Integration and Testing
19
GRID Panel All use cases has their entry point at Grid Panels,
details of the record can be view in pop-up window and arranged in tabs.
Grid Panels are build much powerful to provide functionalities such aso Filter/Search Records ( Including advanced search) o Refresh the Grid without navigating away from the
page.o Pagination.o Add, Remove and Update records, all in one request
to server (which enhance usability and makes less server calls)
o Sorting by columns and mix of columns.
21
Tab Panels with Forms Detail of records are shown in a pop-up window. Pop-up window can include as many tabs as
required. Tabs contains as many forms as required using
Accordion layout.
23
Event Based UI programming model
Following important events are used to make server calls upon events trigger when User interacts with the system.o beforeShow (to assemble different forms and their data
before it shown to the user.)o afterRequest (to fetch the records to sync UI store with
database asynchronously and avoid any race conditions)
o beforeRequest (to set parameters to the request)o beforeDestroy (to avoid destroying the pop-up
windows and forms to enhance the performance of the system)
o expand (upon expanding the accordion layout’s panels)o Collapse( upon collapsing the accordion layout’s
panels).o beforeRender (executes before rendering any view)
25
Filter/Search Records
: Service : Service : AirJobController : AirJobController : AirJobService : AirJobService : AirJobDAO : AirJobDAO : FilterCallBackImpl : FilterCallBackImpl : HibernateTemplate : HibernateTemplate
1: searchJobs( )
2: createFilterMap( )
3: getJobList(FilterMap)
4: getAirJobs(FilterMap)
5: FilterCallBackImpl( )
6: execute(FilterCallBackImpl, FilterMap)
7: doInHibernate( )
8: listRecords( )
26
Transaction Management and Concurrency Control
Optimistic Concurrency control mechanism is used.
This is achieved by version checking against session and retrieved objects, upon any update and delete.
27
Versioning to control Concurrent updates
RequestContextHolder
Request
Session
Version
Version
DAO
ECMS DB
28
Navigation Controls A portal style of navigation controls implemented. Java Scripts are loaded and un-loaded in and from
the browser’s DOM respectively to build UI components.
Single page provide access to all the functionalities.
29
Spring Security• Plug and play way of applying security to the web
application.• More configuration less of coding to maintain the
security aspects of the application.• Aspect Oriented Programming model (AOP)• Spring Security 3.0 release is experimented and
successfully plugged into Spring Framework 3.x.• Secure and extremely secure folders are created to
secure static and dynamic contents of server.• Access level of such folders are described in security
configuration xml.• Cryptography is used to protect password from
exposure.
31
Security Context
Security Context
Authentication Object
WebAuthenticationDetails
ObjectUser
Authority
32
Hibernate (DAO Layer) JPA with Hibernate 3 as persistence provider DAOs are configured through Dependency Injection
and participate in Spring's resource and transaction management. <bean id="transactionManager"
class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory"><ref
bean="sessionFactory"/></property> </bean>
Open Session In View Patterno To prevent LazyInitializationException" while rendering the
view CascadeType.ALL
o For all parent-children OneToMany relationships in the system, such as customer to suppliers, job to subjobs etc
35
Most popular open source Java reporting engine. Jaspersoft iReport Designer 4.1.3 is used to
design the 9 reports used in the system -> save us a lot of time
Easy Spring integration by configuring ViewResolver
<bean id="pdfAirCosting" class="org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView"><property name="url" value="/WEB-INF/reports/aircosting.jrxml" /><property name="reportDataKey" value="datasource"/>
</bean>
Spring framework automatically compiles the .jrxml file on the fly into .jasper file on server starts up
The Spring ModelAndView is populated with report parameters in order to render the report properly
Jasper Report
37
Spring Framework's email support is used to send emails to simplify the e-mail sending process via JavaMail API.
Gmail SMTP server is used Bean configuration file
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
<property name="host" value="smtp.gmail.com"/> <property name="port" value="25"/> <property name="username" value="[email protected]"/> <property name="password" value=“…"/> <property name="javaMailProperties"> <props>
… </props>
</property>38
Race Conditions During the coding, many race conditions
are discovered, because of asynchronous nature of the requests.
Among such scenarios the most encountered one is, when a code segment is in under UPDATE or CREATE operation, during this time sending a SELECT request for the same record within the same session is found to be a race condition.
Above race condition identified, and resolved by using afterRequest event handle the SELECT request to update the UI Store.
40
Race Conditions-Problem
UIController DespatcherServlet UserCaseController UserCaseService DAO
1 : updateRecord()2 : delegate update request()
3 : getRecord()4 : delegate select request()
5 : marshal and update to database()6 : saveOrUpdate()7 : getRecord()
8 : getRecord()
9 : result()
10 : execute update()
11 : return()
Race condition hereResult with no updates 41
Race Conditions-Solution
UIController DespatcherServlet UserCaseController UserCaseService DAO
1 : updateRecord()2 : delegate update request()
3 : marshal and update to database()
4 : saveOrUpdate()
5 : execute update()
6 : return()7 : fire afterRequest event()
8 : getRecord()9 : delegate select request()
10 : getRecord()11 : getRecord()
12 : result()
After request event fired 42
Technical Challenges Novelty of technology at UI layer.
o ExtJS 4.0 released in April 2011, hence not a mature online contents to study the technology.
o ExtJS documentation studied and referenced.o Wiki pages were used to share the knowledge within the
team.• www.code.google.com/p/iss2011s7/w/list
JSON Parser wasn't able to parse, if object properties contain null valueso Work around
• Null values are replaced with empty string before it transmitted from server to UI layer.
o Long term fix strategy• JSON Parser to be fixed.
43
Technical Challenges Handling complex objects at UI Layer (ExtJS)
o Mapping between objects Communication and parsing of Complex object
from UI to Service Layer.o Additional Transfer Objects used to communicate.
Lazy Fetching o Lazy fetching was not able to achieve because of JSON
Parser limitation of unable to handle null values, where lazy fetching operations are tend to contain null values for contained complex objects.
44
Future aspects and improvements
Refreshing the stale records by estimating user’s operation Rest Time.o UI layer can be enhanced to have capability to refresh
the data grids by estimating user’s rest time, and if it reaches a particular threshold value, the system would refresh the data grid by using beforeActivate event of the RowEditor.
o Above would avoid user to get into a situation of updating a stale record on grid, and end up with unsuccessful updates.
46
Future aspects and improvements
Enhancing UI for Mobility in work placeo Proposing client for an update of UI version for
Tablets and Smart Phones. o ExtTouch( A mobile javascript framework)
shall be used to built tablet and smart phone applications.
o HTML 5 standards.o User Interface shall required to update and
services may remain as it is. This is to have an advantage of mobility
and instant access to the application with greater performance.
47
Future aspects and improvements
Integration Requiremento Understand from client that they would like to have
operations to be integrated to the third party Accounts system.
o Proposal for an integration between both of the systems can be considered.
48
Future aspects and improvements
Concurrent updates acknowledgemento Grid Panel records can be highlighted in red color of
text to notify users that the local copy of the record is stale or no more fresh, and any updates to the stale data will not be persist in database.
o The above can be achieve by Observer Design Pattern and Push model of communication from server.
49
Doing It Again After getting full understanding of the
domain (cargo management), we would like to go for more generalized and multi-tenancy approach of building this application.
Metadata entity model can be used instead of rigid domain model, by which we can achieve customization requirements of data grids, forms and any other view panels for different customer.
Spring’s web service framework can be used to expose server side operation as web services, if necessary.
Releasing it as a software as a service (SaaS).
50
System testing completed with defects identified fixed and verified during regression testing
Acceptance testing first round completed Looking into feedbacks from first round – mainly involves
fine-tuning work to better integrate system to client business flow
So Now…
And Next… Planning for second round of acceptance testing with focus on
non-functional such as performance and availability On-site deployment Provision for user training and bug fixing for 2 months warranty
period
52
Produce ERD
Produce Sequence Diagrams
Specify object attributes/operations
Produce Design Model Report
Produce DB Logical Design
Produce DB Physical Design
Produce Java Code
Define DB tables and fields
Perform Unit Testing
Perform Systems Integration
Prepare Systems Test Plan
Perform Systems Testing
Produce Test Report
Review System Test Results/Corrective Action
Write User Guide
Write Acceptance Test plan
0 10 20 30 40 50 60
Expended EffortBudgeted Effort
man-days
Budgeted Effort Vs Expended Effort
56
Quality Assurance
• Feature by feature integrated and released for testing. Last test run on fully integrated system.
Testing Strategy
• Test Coverage = 75%
Test Run (V0.1 – 0.5)
• Test Coverage = 95%
Test Run (V0.6)57
Management Challenges
Taken longer time in technology familiarization, result slippage in later activities such as testingo Adopted feature by feature integration testing approach
Small team, big scopeo Constantly looking for reuse in all phases – use case
design, implementation, test case
59
Top Related