0% found this document useful (0 votes)
29 views6 pages

JPL Practice T04

JPL.Practice.T04

Uploaded by

bachnqhe187105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views6 pages

JPL Practice T04

JPL.Practice.T04

Uploaded by

bachnqhe187105
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Java SE 8 Programming Language Issue/Revision: 1.

1
CODE: JPL.Practice.T03
TYPE: N/A

LOC: N/A

DURATION: 180 MINUTES

Require 001: Working tools and Delivery Domain objects


requirements (represent things in our application domain)

• Working tools: Eclipse IDE for Java


Persistence services
(handle saving and retrieving data as objects)
• Delivery: Source code and test results in a compressed

archive. Require 002: Technologies

The product illustrates:

• OOP: Inheritance, Encapsulation, Polymorphims,

Abstraction • String, Java Collection (List, Set, Map)

• Lambda Expressions and Functional Interfaces

• Java I/O Fundamentals

• JDBC: Statement, PreprareStatement,

CallableStatement, Batch • Base Java Knowledge in the

course.

Require 003: Technical

Problem 02 will be developed using the following


architecture:
PropertyManager get
Application Layer property from
(provides the logic and functionality for our application.)

ConnectionManager

• The Application Layer consists of all functions described in the


functional requirements section.

• The domain layer contains objects and logic related to our application. In this layer, you need to
develop all the entity classes corresponding to your tables in database.

• The persistence layer contains data access objects (DAO) that provide services for accessing
persistent data. DAO provide 4 basic services referred to as CRUD:
o Create: save new object data to the database.
o Retrieve: find object data in the database and recreate objects. There may be several
methods for this service to enable different forms of object lookup.
o Update: update data for an object already saved to the database.
o Delete: delete object data from the database

• Each layer should be organized in a separated package.

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 4/9


Java SE 8 Programming Language Issue/Revision: 1.1

Require 004: Technical Requirements

• Use Object-Oriented programming style.

• Follow the standard naming and coding convention. • Add appropriate

comments for each class, method, attribute, … • Use console

application template

• Create a new project and the appropriate packages •

Programming Java with JDBC.


25e-BM/HR/HDCV/FSOFT v1.1 Internal use 5/9
Java SE 8 Programming Language Issue/Revision: 1.1

Create a project named JPL.Practice.T03 to resolve the follow problems:

Problem 01: Class, Object, OOP, Collection, Stream, Filter, IO

Specifications:
The Person class contains the manager information:

✓ Attributes: id (String), name (String), phone (int), email (String), address (Address), birthday (Date)

✓ Methods:
o getter/setter methods
The Address class contains the manager information:

✓ Attributes: id (Integer), ward (String), district (String), provincial (String)

✓ Methods:
o getter/setter methods

Data Constraint Requirements:


Create the Validator class to check the data as follows:

✓ The email of person length is a minimum of 6 characters and follows email format. ✓ The

person ids are not duplicated

✓ The person bod after current date.

Functional Requirements
Create a new package named fa.training.problem01 in the JPL.Practice.T04 project that contains the
above classes and following classes:

Create a PersonManagement class that has the following methods:


public class PersonManagement {
private List<Person> persons = new ArrayList<>();

public List<Person> getPersons() {


return persons;
}

public void setPersons(List<Person> persons) {


this.persons = persons;
}
}
a) A method to input a list of Person and store the ‘persons’.
The prototype of this methods:
/**
* This method to enter data from keyboard and
* stored to a ‘persons’.
*/
public void inputData(){
// method body
}
b) Create another method to find all of the persons have provincial start with a specific string
Prototype of the above methods:

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 6/9


Java SE 8 Programming Language Issue/Revision: 1.1

/**
* The method to find all of the persons have provincial starts with a
specific string.
* @param provincial: is a specific string.
*/
public List<Person> findByProvincial(String provincial){
}
c) Write a method to classify person by year of birthday.
Prototype of this method:

/**
* The method to classify persons by year.
* @return map: year->key, value: list of persons.
*/
public Map<Integer, List<Person>> classifyByYear() {
}

Example:
2016: [Person [id=PS0001,…], Person [id=PS0004,…]]
2019: [Person [id= PS0002,…], Person [id= PS0003,…]]

✓ Test class contains main() method to test all of the above methods of CarManagement
class.

Estimate time: 60 minutes

Mark scale : 30% (received partial (max 70%) if not using Java 8)

- OO design/Class design: 10 %; - File format - Functional Requirement 60%; - Main


Requirements: 20%; method: 10%

Problem 02: OOP, Collection, JDBC, Exception


Specifications:
Trainees are required to develop a Java console application based on Java core and JDBC programming
knowledge learned from the course to manage Course (Course Management System).

Database Requirements:
Create a new database schema named JPL_TEST04 for this application that contains the following:
25e-BM/HR/HDCV/FSOFT v1.1 Internal use 7/9
Java SE 8 Programming Language Issue/Revision: 1.1

Contraints:

✓ Is_complete: accepts only value 1 (completed), 0 (not completed).

Notice that the default schema is ‘dbo’.


Technical Requirements:
Create a new package named fa.training.problem02 in JPL.Practice.T04 project. The trainee
must create some appropriate sub-packages to contain classes in this problem. E.g

✓ fa.training.problem02.entities to manage entity classes, let use the appropriate 'is-a' or 'has-a'
relationship,

✓ fa.training.problem02.dao to manage data access objects,

✓ fa.training.problem02.utils to manage the classes that process data constraint, utility classes if
needed, etc.

Functional Requirements:
a. The program has a way of creating a new course (method named save(Course course)).

b. The program has a way of creating a new student with a course that already exist. If the course is
not found, the method will throw the NotFoundException exception with the message via pattern:
“Error: {course_title} is not found” (method named save(Student student, Course course)).

c. The program has a method to show all courses and total students learning (not complete) using a
transaction in a user-defined stored procedure (method named readAllCourseInfo()). Example:
[[id= 1, courseTitle=”JAVA Core 001”, total=20], [id= 2, courseTitle=’Angular JS 001’, total=0]]

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 8/9


Java SE 8 Programming Language Issue/Revision: 1.1

d. A new method to show the top 10 students that their status is "completed" and their highest score in
the "Java Core 001" course, method named getTopStudents (int limit, String courseTitle, Boolean
isCompleted).

e. The program has a function to list all the students by course title and sort descending list register
date, method named findAllByCourseTitle(String).
Ja

Note: all the functions you have implemented above must use entity classes, persistence classes in
domain and persistence layers.

User Interface Requirement


The program has a screen console for UI

The main screen allows selecting the functions for:

1. Student management

- save: Functional Requirements - (b).

- getTopStudents: Functional Requirements - (d).

2. Course management

- save: Functional Requirements - (a).

- readAllCourseInfo: Functional Requirements - (c)

- findAllByCourseTitle: Functional Requirements - (e).


3. Close program

Estimate time: 120 minutes


Mark scale : 70%

- OO design/Class design : 15%; Architecture - Functional Requirement : 55%; - User Interface


- DB Design/Connection : 15%; --THE END-- Requirement : 15%

25e-BM/HR/HDCV/FSOFT v1.1 Internal use 9/9

You might also like