Ask a question from expert

Ask now

Refactoring and Implementing DAOs with Java Generics and Design Patterns

5 Pages775 Words296 Views

Added on  2019-09-22

About This Document

This project involves refactoring Java classes such as Course, Book, Person, and LabRoom, and implementing DAOs using Java Generics and Design Patterns. It includes creating an Abstract Factory and JUnit test cases for testing the DAOs.

Refactoring and Implementing DAOs with Java Generics and Design Patterns

   Added on 2019-09-22

BookmarkShareRelated Documents
Send the exported eclipse project by end of Friday, June 24, 2016.1.Create a Category enum with Computer, Language, Math, Science, Engineering in package com.comp424.enumdef2.Use Java Generics to create IPersistentObject interface in the parameter ID Extends from Serializablevoid : setID(ID)ID : getID()3.Refactor Course classCategory : category.Boolean : isExpiredCourse : replacementCourse4.Refactor Book classCategory : category.5.Refactor Person class.Extract Address class to its own file. Address class remains in the same package.Remove name attribute and its getter and setter.Add attribute lastName and FirstName and their corresponding getters and settersRemove phoneNumber;Add attribute mobile and homePhone and their corresponding getters and setters6.Refactor Location.Rename Location to LabRoom
Refactoring and Implementing DAOs with Java Generics and Design Patterns_1
Remove all attributes and their getters and setters except roomNumberExtends from Address classAdd Integer : capacity7.Remove EnrollmentPolicy class and from Person class.8.Refactor Book, Course, LabRoom, Person to implement IPersistentObject with Long parameter.9.Use Java Generics to create base DAO interface in the package com.comp424.intf.daoInterface Name is IBaseDaoContains parameters T and ID.Contains the following methods:getAll() - return a list of object of specific typefindByID(ID id) - return an object of specific typepersist(T t) – persist a new object. update(T t) – update an existing object in persistent storedeleteByID(ID id) – delete an objectdelete(T t)All methods can throw Exception10.Using IBaseDao to create the DAO interface for the specific typeCourse, Book, LabRoom, Person in the package com.comp424.intf.dao. All interfaces use Long as ID. Name each file as I<Type>Dao. For eg., ICourseDao. Refer to the following steps for further instructions11.ICourseDao contains the following methods:Course : findByName(String)Course : findByCode(String)
Refactoring and Implementing DAOs with Java Generics and Design Patterns_2

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Create Model. Create package com.comp424.model. Remembe

Implementation of Prototype System