logo

Refactoring and DAO Implementation

   

Added on  2019-09-22

5 Pages775 Words296 Views
 | 
 | 
 | 
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 package.com.comp424.intf.dao.Contains 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 DAO Implementation_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 DAO Implementation_2

End of preview

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

Related Documents