M18 - Case Study
M18 - Case Study
M18 - Case Study
Module Objectives
At the end of this module, participants will be able to:
Describe the application architecture used by the case study
application
Identify and describe the deliverables that must be provided in order
to complete the case study
Identify and describe the roles, responsibilities, and deliverables of a
developer during this case study
Application Overview
The application is a simulation of an Employee database
containing records of an Employees basic profile, projects and
skills.
The application provides the ability for a user to search for
employees via their names or their projects and to obtain details
on their project history and skill set.
Application Use-Cases
Application Overview
HRS Services
Repositories
Spring MVC
Domain Objects
MySQL Database
Sequence Diagram
JSP
Controller
Service
Repository
Database
Return Result
Employee
1
Project
EmployeeDetail
EmployeeProjectDetail
N
ProjectRole
N
EmployeeSkill
* Contains
10
11
Services (Stub)
Controllers
JSP
Repository
Data Layer
Presentation Layer
MySQL Database
For implementation
12
TODOs
Design, document, and implement a database schema that
represents the information and relationships the applications
logical data model at a database level.
Design and implement repository classes that will provide
access to the information stored in the database.
Re-implement the stub service classes in order to make use of
the repositories to access its data instead of returning dummy
data.
13
TODOs
Complete the Functional Test plan. A partially implemented test
plan is already provided for you:
14
Hints
Make sure you understand the definitions and the relationships
described by the logical data model. This will greatly influence
the way that you design the database schema.
Pay careful attention to the requirements of the service layer.
This will determine what kind of data the service layer will accept
from the controller, and what kind of data will be returned. This
will influence how you design your repositories (DAOs).
Make sure the design and interface across layers are properly
understood. Know what parameters to send, and what values to
expect (refer to the sequence diagram).
15
16
DataSource
17
Dependency Declaration
One approach would be for the DAO itself to have code that
constructs a DataSource that connects to a specific database
instance.
This approach will lock the DAO to that specific database
instance. If the database changes, the DAO would have to be
recoded and recompiled.
18
Dependency Injection
The dependency injection
approach injects the
DataSource into the DAO
through external configuration
files.
The DAO class itself is not
concerned how it gets a
DataSource object and does
not have any implementation
specific code needed to get a
DAO reference.
The DAO can have different
DataSource implementations
injected as required without
having to change its code
MySQL
Database
DataSource
Implementation
DAO
DataSource
Oracle
Database
DataSource
Implementation
19
Dependency Injection
Dependency injection is configured through XML-based
configuration files.
Each configuration file defines beans which are objects that we
want the Spring framework to manage.
The dependencies between beans are configured through the
xml (called wiring beans).
20
Note that the ref property is used instead of the value property. This means
that the it is injecting a reference to another bean.
22
23
24
Schedule
25
Schedule
26
Schedule
27
Schedule
28
Schedule
DAY 20 : Removal of Open Source Software
Everyone is expected to remove the following OSS from the
workstation:
Eclipse 3.4
JDK 1.6
MySQL 5.0
Spring 5.0
Subeclipse 1.4.x
Subversion 1.5.x
Tomcat 6.0.16
Tortoise 1.5.3.13783
29
Appendix
Spring
Version
License
: 2.5.5
: http://www.apache.org/licenses/LICENSE-2.0.html
Subversion
Version
License
: 1.5.2
: http://subversion.tigris.org/license-1.html
Tomcat
Version
License
: 6.0.16
: http://www.apache.org/licenses/LICENSE-2.0
30
Appendix
Tortoise
Version
License
: 1.5.3.13783
: http://www.opensource.org/licenses/gpl-license.php
Subeclipse
Version
License
: 1.4.x
: http://www.eclipse.org/legal/epl-v10.html
31
32