Tải bản đầy đủ - 0 (trang)
Appendix A. Downloadable Code for This Book

Appendix A. Downloadable Code for This Book

Tải bản đầy đủ - 0trang

Third-PartyLibrariesSharedDirectory

Thefollowingthird-partyJARfilesareusedbythethreeweb

applicationsdescribedinthisappendix.Thesearepickedupby

theAntbuild.xmlscriptsforeachofthesethreeprojectsand

bundledintheirrespectivedeployableWARfile.



Note

Itypicallyhavethelib/directoryunderneaththespecific

project(forexample,rapidjava/timex/lib/);however,toreduce

thesizeofthebookcode.zipfile,Ihadthethreeprojectsshare

thisonelib/directorybecauseeachoftheseprojectsrequired

almostthesamesetofexternalJARfiles.



rapidjava/lib/activation.jar

rapidjava/lib/antlr-2.7.6rc1.jar

rapidjava/lib/asm-attrs.jar

rapidjava/lib/asm.jar

rapidjava/lib/cglib-2.1.3.jar

rapidjava/lib/commons-beanutils-1.7.0.jar

rapidjava/lib/commons-collections-2.1.1.jar

rapidjava/lib/commons-lang-2.1.jar

rapidjava/lib/commons-logging-1.0.4.jar

rapidjava/lib/displaytag-1.1.jar

rapidjava/lib/displaytag-export-poi-1.1.jar

rapidjava/lib/dom4j-1.6.1.jar

rapidjava/lib/ehcache-1.1.jar

rapidjava/lib/hibernate3.jar

rapidjava/lib/hsqldb.jar

rapidjava/lib/itext-1.3.jar

rapidjava/lib/javax.servlet.jar



rapidjava/lib/jstl.jar

rapidjava/lib/jta.jar

rapidjava/lib/junit.jar

rapidjava/lib/log4j-1.2.11.jar

rapidjava/lib/mail.jar

rapidjava/lib/quartz-1.5.1.jar

rapidjava/lib/spring-hibernate3.jar

rapidjava/lib/spring-mock.jar

rapidjava/lib/spring.jar

rapidjava/lib/standard.jar







SampleApplicationDirectory

(rapidjava/timex/)

Thefollowingfilesarerelatedtothesampleapplicationnamed

TimeExpression,introducedinChapter2,"TheSample

Application:AnOnlineTimesheetSystem."Thesefilescanbe

foundundertherapidjava/timex/directory.



AntFiles

antextras.xml

build.xml

local.properties

timexhsqldb.xml



HSQLDBDatabaseFiles

data/timexdb.lck

data/timexdb.log

data/timexdb.properties

data/timexdb.script



Configuration/JavaSource

src/conf/log4j.properties

src/conf/messages.properties



src/conf/springtest-applicationcontext.xml

src/conf/timex-servlet.xml

src/conf/timex.tld

src/conf/web.xml

src/java/com/visualpatterns/timex/controller/EnterHoursControll

src/java/com/visualpatterns/timex/controller/EnterHoursValidato

src/java/com/visualpatterns/timex/controller/HttpRequestInterce

src/java/com/visualpatterns/timex/controller/MinutesPropertyEdi

src/java/com/visualpatterns/timex/controller/SignInController.j

src/java/com/visualpatterns/timex/controller/SignInValidator.ja

src/java/com/visualpatterns/timex/controller/SignOutController.

src/java/com/visualpatterns/timex/controller/TimesheetListContr

src/java/com/visualpatterns/timex/job/ReminderEmail.java

src/java/com/visualpatterns/timex/model/AuditInterceptor.java

src/java/com/visualpatterns/timex/model/Department.hbm.xml

src/java/com/visualpatterns/timex/model/Department.java

src/java/com/visualpatterns/timex/model/DepartmentManager.java

src/java/com/visualpatterns/timex/model/Employee.hbm.xml

src/java/com/visualpatterns/timex/model/Employee.java

src/java/com/visualpatterns/timex/model/EmployeeManager.java

src/java/com/visualpatterns/timex/model/hibernate.cfg.xml

src/java/com/visualpatterns/timex/model/Timesheet.hbm.xml

src/java/com/visualpatterns/timex/model/Timesheet.java

src/java/com/visualpatterns/timex/model/TimesheetManager.java

src/java/com/visualpatterns/timex/test/AllTests.java

src/java/com/visualpatterns/timex/test/DemoNewJavaFeatures.java

src/java/com/visualpatterns/timex/test/HibernateTest.java

src/java/com/visualpatterns/timex/test/SimpleTest.java

src/java/com/visualpatterns/timex/test/SpringTest.java

src/java/com/visualpatterns/timex/test/SpringTestMessage.java

src/java/com/visualpatterns/timex/test/TimesheetListControllerT

src/java/com/visualpatterns/timex/test/TimesheetManagerExtras.j

src/java/com/visualpatterns/timex/test/TimesheetManagerTest.jav

src/java/com/visualpatterns/timex/util/ApplicationSecurityManag

src/java/com/visualpatterns/timex/util/DateUtil.java

src/java/com/visualpatterns/timex/util/HibernateUtil.java

src/java/com/visualpatterns/timex/util/PayPeriodCheckTag.java



src/java/com/visualpatterns/timex/util/TimexJmxBean.java

src/java/com/visualpatterns/timex/view/enterhours.jsp

src/java/com/visualpatterns/timex/view/signin.jsp

src/java/com/visualpatterns/timex/view/timesheetlist.jsp

src/web/index.jsp

src/web/rapidjava-ajax.html

src/web/rapidjava-ajax.jsp

src/web/includes/timex.css







RefactoredSampleApplicationDirectory

(rapidjava/timex2/)

Thefollowingfilesarerelatedtothematerialdiscussedin

Chapter10,"BeyondtheBasics."Thesefilescanbefound

undertherapidjava/timex2/directory.

Thislistingprovidednextlistsonlyfilesimpactedasaresultof

refactoringdonetothesampleapplication(seeAppendixB,

"RefactoringDonetoSampleApplication,"fordetails);theother

filesfoundundertimex2/aresimilartothefilesdescribedfor

timex/inthissection.



antextras.xml

build.xml

local.properties

timexhsqldb.xml

src/conf/timex2-servlet.xml

src/java/com/visualpatterns/timex/model/DepartmentManager.java

src/java/com/visualpatterns/timex/model/EmployeeManager.java

src/java/com/visualpatterns/timex/model/hibernate.cfg.xml

src/java/com/visualpatterns/timex/model/TimesheetManager.java

src/java/com/visualpatterns/timex/test/TimesheetManagerTest.jav

src/java/com/visualpatterns/timex/view/dberror.jsp

src/java/com/visualpatterns/timex/view/enterhours.jsp

src/java/com/visualpatterns/timex/view/includemessages.jsp

src/java/com/visualpatterns/timex/view/signin.jsp

src/java/com/visualpatterns/timex/view/timesheetlist.jsp



Spring-HibernateIntegrationDemoDirectory

(rapidjava/springhibernate/)

ThefollowingfilesarerelatedtotheSpringandHibernate

integrationsectioninChapter10.Thesedemonstratetwostyles

ofusingSpring'ssupportAPIforHibernate(forexample,to

leverageSpring'sdeclarativetransactionmanagementsupport).

conf/springhibernate-servlet.xml

conf/web.xml

build.xml

src/controller/TimesheetSaveController.java

src/model/Timesheet.hbm.xml

src/model/Timesheet.java

src/model/TimesheetManager.java

src/model/TimesheetManagerImpl1.java

src/model/TimesheetManagerImpl2.java

src/view/dberror.jsp

src/view/timesheetsave.jsp







B.RefactoringDonetoSample

Application

THEFOLLOWINGCODE,CONFIGURATION,ANDSCRIPT

excerptsshowafewsimpleexamplesofhowthesample

applicationinthisbookwasrefactoredasitwasbeingbuilt

incrementally.



Note

Thebook'scodezipfilecontainstwoprojectdirectoriesforour

sampleapplication:timex/andtimex2/.Thelattercontainsmuch

oftherefactoredcodediscussednext.

Becauseyouhavebothversions,youcancomparethetwocode

basestoseehowrefactoringworksintherealworld.

Remember,itisn'taboutbeingperfectthefirsttimejustgood

enough.Geteverythingworkingfirst;thenoptimizeyourcode

later.Thisiswhatrefactoringisallaboutcontinuousdesignand

redesign,byimprovingcodeasnecessary,versustryingto

perfecteverythingupfront.

Fordetailsontheconceptsandtypesofrefactoring,visit

refactoring.com.







SignInController.java:JMXMonitoring

ThefollowinglinesofcodewereaddedforJMXmonitoring

purposes:



importcom.visualpatterns.timex.util.TimexJmxBean;

privateTimexJmxBeantimexJmxBean;

...

timexJmxBean.setSignInCount(timexJmxBean.getSignInCount()+

...

publicTimexJmxBeangetTimexJmxBean()

{

returntimexJmxBean;

}

publicvoidsetTimexJmxBean(TimexJmxBeantimexJmxBean)

{

this.timexJmxBean=timexJmxBean;

}







Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Appendix A. Downloadable Code for This Book

Tải bản đầy đủ ngay(0 tr)

×