1 / 16

AppFuse Architecture

AppFuse Architecture. Directory Structure, Build/Test/Deploy Processes. Project Structure. Directory structure Simpler is better Map to artifacts Customizations/personalization's IDE issues Separate source from artifacts - cleanable . Top-level Directory Structure.

said
Télécharger la présentation

AppFuse Architecture

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. AppFuse Architecture Directory Structure, Build/Test/Deploy Processes

  2. Project Structure • Directory structure • Simpler is better • Map to artifacts • Customizations/personalization's • IDE issues • Separate source from artifacts - cleanable

  3. Top-level Directory Structure • bin – automation scripts • lib – 3rd party libraries (i.e. Struts and Hibernate) • metadata – SQL scripts, server configurations and XDoclet fragments • src – Java source files • test – JUnit, Cactus, StrutsTestCase tests • tools – Strutsgen: a tool for generating JSPs from ActionForms • web – JSPs, properties files, images, scripts, stylesheets

  4. Open Source Dependencies • Ant-contrib– use “propertycopy” task in build process • Checkstyle – used to verify that coding standards are followed • Dbunit– cleans/loads data into database before tests are run • Display Tag– used to display list screens (including sorting/paging) • Hibernate– persistence engine • Cactus – for unit testing server-side java code • Log4j– logging framework, includes e-mailing errors • Struts – web application framework, we use JSPs and Servlets • Java2HTML – creates HTML pages of .java files … continued

  5. Open Source Dependencies, cont. • JUnitDoclet – generates skeleton test cases for a class’s methods • PMD – inspects code for unused variables, parameters, etc. • StrutsMenu – navigation system • StrutsTestCase – extension of Cactus to test Struts’ Actions • WebTest– used to test JSPs • XDoclet – code and deployment descriptor generator

  6. Java Directory Structure src & test org.appfuse… common ejb web

  7. Ant Build File • XML format • In project root directory • Default name: build.xml • Declarative - define steps, not scripty details • Defines a single project • A project contains targets • Targets contain tasks

  8. AppFuse Tasks • Main tasks in appfuse project • clean • ejbdoclet and webdoclet • compile-module (where module is common, web or ejb) • package-module • deploy • test-module

  9. build/deploy process

  10. Test process

  11. XDoclet’s Role • Generates Hibernate mapping files (.hbm.xml) - <ejbdoclet> • Generates Struts’ ActionForms from POJOs - <ejbdoclet> • Generates Validator’s validation.xml from ActionForms - <webdoclet> • Generates web.xml and struts-config.xml - <webdoclet>

  12. XDoclet Examples • Hibernate: User.java • @hibernate.classtable=“app_user" • Generating ActionForms: User.java • @struts.forminclude-all="true"extends=“BaseForm"

  13. XDoclet Examples, cont. • Generating entries in struts-config: UserAction.java • @struts.actionpath="/saveUser"name=“userForm“ scope="request"validate="true" parameter="action" input=“editUser"

  14. User Interface • Constructed with Tiles – web/layouts/baseLayout.jsp controls the entire layout of the site. • Uses Struts JSP tags for editing/saving forms. • Uses JSTL for conditionals, includes and messages.

  15. User Interface, cont. • XHTML 1.0 and CSS 2.0 • Allows validation • Cleaner HTML (all attributes lowercase, etc) • DOCTYPE switching

  16. More Resources • AppFuse Project Homepage • http://raibledesigns.com/appfuse • http://raibledesigns.com/appfuse/tutorials • Java Development with Ant • http://www.ehatchersolutions.com/JavaDevWithAnt • Enhance J2EE component reuse with XDoclet • http://www.arc-mind.com/papers/ws-j2x-ltr.pdf • Step-by-Step tutorial on using XDoclet to write your own custom templates • http://www.arc-mind.com/papers/xdoclet2.pdf • Ant, JUnit, XDoclet Presentations • http://ehatchersolutions.com/downloads/presentations

More Related