Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Information

This details the recommended structure for Sakai 2.2 4+ applications (or tools). (powerpoint)
This is the new simplified structure which makes maven2 easier to work with

Application structure

  • Basic tool structure
    tool -> logic-api -> logic-impl -> dao-api -> dao-impl
  • Model connection
    model -> logic-api, dao-api, etc...
  • Optional service connection
    public-api -> logic-api

NOTE: Ideally the DAO api would not be in shared but the current component model does not allow for this

File Structure

  • app-name
      api
    • eclipse .project here (name the project <app-name>-api)logic - project with the interface for the business logic and dao (logic and dao api)
      Deploy as a jar to shared [model-api]model - project with the value objects (POJOs) (also interfaces if you want to use them)all interfaces, model objects, and hibernate hbm files
      Deploy as a jar to shared [ - no dependencies ]
      public - project with the interface for the public api (often called service in Sakai)
      Deploy as a jar to shared (optional) [model-api, logic-api]impl
      eclipse .project here (name the project <app-name>-implapi)
      • dao - project with data access implementation (dao impl)
        Deploy as a jar, include in pack [model-api, logic-api, hbm]
      • hbm - project to hold the hibernate hbm files (*.hbm.xml)
        Must be deployed to shared as a jar for the global session factory (optional) [ - ]
      • logic - project with business logic impl (logic implementation)src - includes interfaces, model objects, and hbm files
      • test - (optional) may include shared test data and mock objects which help other with tests
    • impl - project at this level
      Deploy as a jar, include in pack [model-api, logic-api, dao-impl]api]
      (optional) eclipse .project here (name the project <app-name>-impl)
      • src - includes java source for all implementations of apis
      • test - includes all unit and integration tests
    • pack - project for components stuff needed by Sakai (should just a set of spring config filefiles)
      Deploy to components [logic-impl , dao-impl (all in war bundle)]
    • tool - project for the tool (interface to the user)
      Deploy as a war [api]
      (optional) eclipse .project here (name the project <app-name>-tool)
      Deploy as a war [model-api, logic-api]
      • src - java src directory
        • java - any java code used for the tool only
        • webapp
          • app-name - JSF jsp files here
          • css
          • images
          • templates - RSF html templates
          • tools - Sakai tool.xml files goes in here
          • WEB-INF - lots of xml config files here (web.xml, applicationContext.xml, etc...

...

  • org.sakaiproject.app-name
    • dao
      all dao api classes
      • impl
        all dao implementation classes
    • hbm
      hibernate mapping files only
    • logic
      all business logic api classes
      • impl
        all business logic implementation classes
    • model
      all value object POJOs
    • service (cannot use public)
      all publically accessible api classes related to the app
    • tool
      all java classes related to the tool (backing beans)
      • jsf, producers, params
        presentation specific classes related to the tool

Note: You may have your own package base instead of org.sakaiproject

Definitions

  • project - a maven project (should have it's own project.xml file)
  • app or webapp - the entire application including the tool, apis, impls, etc...
  • tool - The part a Sakai user interacts with
  • public-api - The api you would make accessible to other programmers (sometimes known as service)
  • logic - business logic or application logic (might be the same as the service)
  • model - The value objects or the POJOs that store the data for your app
  • dao - The data access layer of your app (a.k.a. data access object), talks to a persistent storage mechanism
  • (optional) - May not be needed depending on your tool structure

...