Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_pt
CreateActions
CreateDAO
CreateDAO_sp
CreateDAOiBATIS
CreateDAOiBATIS_ko
CreateManager_es
JSFBeans
SpringControllers
...and 3 more




JSPWiki v2.2.33

[RSS]


Hide Menu

CreateManager


This is version 4. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


Part II: Creating new Managers - A HowTo for creating Business Delegates that talk to the database tier (DAOs) and the web tier (Struts Actions).

About this Tutorial

This tutorial will show you how to create a Business Delegate class (and a JUnit) to talk to the DAO we created in Part I of this tutorial.

In the context of AppFuse, this is called a Manager class. It's main responsibility is converting backend data (POJOs) into front-end data (Struts ActionForms). The main reason I even use Managers, rather than just calling the DAOs directly is testability. It's nice to be able to populate a Form manually (in the test) and call the DAO to persist it, and verify the database gets the proper results. The Business Delegate pattern from Sun says that these objects are usefull for de-coupling your presentation layer from your database layer. Managers should also be where you put any business logic for your application.

I will tell you how I do stuff in the Real World in text like this.

Let's get started on creating a new ManagerTest and Manager in AppFuse's architecture.

Table of Contents

  • [1] Create a new ManagerTest to run JUnit tests on the Manager
  • [2] Create a new Manager to talk to the DAO
  • [3] Run the ManagerTest

Create a new ManagerTest to run JUnit tests on the Manager [#1]

Create a new Manager to talk to the DAO [#2]

Run the ManagerTest [#3]



Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:32 MST by MattRaible.