Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Web.xml load: spring applicationContext and frontcontroller – servlet mappings: *.jsp -> dispatchServlet ApplicationController formController.

Similar presentations


Presentation on theme: "Database Web.xml load: spring applicationContext and frontcontroller – servlet mappings: *.jsp -> dispatchServlet ApplicationController formController."— Presentation transcript:

1 Database Web.xml load: spring applicationContext and frontcontroller – servlet mappings: *.jsp -> dispatchServlet ApplicationController formController ApplicationController Handler() { // call business logic, // return model and view. } simpleController Handler() { // call business logic, // return view. } StudentValidato r Validate() StudentManager findStudentsByName() { students = StudentDao.findStudentsByName(); // perform business logic on students: if(students==null) {StudentDao.helplist}; return students; } Service findStudentsByName() { return sqlMap.getStudents(); } StudentDao sqlMap.xml (Ibatis) SELECT * FROM STUDENTS … Data Access Object SqlMapConfig.xml - Database / JDBC Config - sqlMap locaties … Ibatis web flow domain service persistence ApplicationController authorManager.findStudentsByName() get / post (d)html / custom javascript Client FrontController urlMapping: *.jsp  appController … … resolve views map models to views render views FrontcontrollerServlet web view StudentUpdater Command Object getName() setName() … ModelAndView Map - view - model See Object-model applicationContext.xml - define beans - wire service beans into controllers - wire dao beans into managers - map exceptions to pages … spring frontcontroller-servlet.xml - define controllers - resolve views... spring

2 web view web flow service persistence domain This layer encapsulates the business logic. It is built with JavaBeans. JavaBeans have a certain state (‘name’, ‘address’, …) and behaviour (‘register()’, …). Goal is to encapsulate all business logic in the domain model. All other layers depend on the domain layer. However: The domain layer may not depend on any other layer. a.k.a.‘user-interface’ layer responsible for the presentation towards the end-user. This layer presents (‘renders’) response data from the web-flow layer. does not contain navigation and no business logic contains Jsp’s (with images and stylesheets) and JavaScript (Ajax). database responsible for the navigation of the end-user. transforms HTTP-requests into general requests (without HTTP specific matters) for the underlying service layer does not contain business logic, but does call business logic in the service layer. contains Servlets (Controller function) uses POJO’s and the JavaBeans from the domain-layer. offers business logic to the web flow layer in the form of ‘coarse grained’ methods (this means that each method represents a use-case). These methods may not contain ‘state’. handles concurrent requests and therefore has to be totally stateless ! contains Manager-JavaBeans uses POJO’s and the JavaBeans from the domain-layer. The JavaBeans will have to contain as much as possible the ‘real’ business logic. responsible for the storage and retrieval of objects from the domain model. Typical strategy herefor are the ‘CRUD’ methods. can only be addressed by the service layer. The service layer is therefore responsible for the coordination of transactions. uses the iBatis SQLMaps framework. responsible for the storage of data and not for business logic. Only in the case of persistency logic or performance matters it is acceptable to store logic in the database.


Download ppt "Database Web.xml load: spring applicationContext and frontcontroller – servlet mappings: *.jsp -> dispatchServlet ApplicationController formController."

Similar presentations


Ads by Google