>
Example Configuration

The configuration shown below represents an example of a spine.xml file used by the spine framework. It depicts all the possible configurations that can be specified in the application framework.

<?xml version="1.0" encoding="UTF-8"?>

<!--//
    Default spine configuration XML file. Contains settings necessary to run the spine application
    create your own settings to drive other application based activities
    //-->

<spine>
    <dataProxies>
        <dataProxy name="com.zphinx.spine.data.impl.FileProxy"
            index="1" />
        <dataProxy name="com.zphinx.spine.data.impl.DataBaseProxy"
            index="2" />
        <dataProxy name="com.zphinx.spine.data.impl.EJBProxy"
            index="3" />
        <dataProxy name="com.zphinx.spine.data.impl.LdapProxy"
            index="4" />
    </dataProxies>


    <!--// The TestProcessor:- Tests a simple processor using a FileDataProxy   //-->
    <processor name="TestProcessor">
        <processorClass>
            com.zphinx.spine.core.viewprocessors.DefaultProcessor
        </processorClass>
        <delegate>

            <subclass>
                com.zphinx.spine.unittests.impl.delegates.SimpleProcessorTestDelegate
            </subclass>
            <dataAccessObject>
                <className>
                    com.zphinx.spine.unittests.impl.dao.DaoTestObject
                </className>
                <proxyIndex>1</proxyIndex>
            </dataAccessObject>
        </delegate>

    </processor>

    <!--// The TestProcessor:- Tests a simple processor using a DatabaseProxy  //-->
    <processor name="TestProcessorData">
        <processorClass>
            com.zphinx.spine.core.viewprocessors.DefaultProcessor
        </processorClass>
        <delegate>

            <subclass>
                com.zphinx.spine.unittests.impl.delegates.SimpleProcessorTestDelegate
            </subclass>
            <dataAccessObject>
                <className>
                    com.zphinx.spine.unittests.impl.dao.DaoTestObjectData
                </className>
                <proxyIndex>2</proxyIndex>
            </dataAccessObject>
        </delegate>

    </processor>

    <!--// The TestMultiDelegateProcessor:- Tests a simple processor which uses multiple delegates and multiple proxies in the order in which they are declared  //-->

    <processor name="TestMultiDelegateProcessor">
        <processorClass>
            com.zphinx.spine.core.viewprocessors.DefaultProcessor
        </processorClass>
        <delegate>

            <subclass>
                com.zphinx.spine.unittests.impl.delegates.MultiDelegateTestDelegate
            </subclass>
            <dataAccessObject>
                <className>
                    com.zphinx.spine.unittests.impl.dao.DaoTestObject
                </className>
                <proxyIndex>1</proxyIndex>
            </dataAccessObject>
        </delegate>
        <delegate>

            <subclass>
                com.zphinx.spine.unittests.impl.delegates.SimpleProcessorTestDelegate
            </subclass>
            <dataAccessObject>
                <className>
                    com.zphinx.spine.unittests.impl.dao.DaoTestObjectData
                </className>
                <proxyIndex>2</proxyIndex>
            </dataAccessObject>
        </delegate>

    </processor>


    <!--// The TestMultiViewProcessor:- Tests a multi-processor using different managed objects  //-->
    <processor name="TestMultiViewProcessor">
        <processorClass>
            com.zphinx.spine.unittests.impl.processors.MultiViewTestProcessor
        </processorClass>
        <multiDelegate>

            <subclass>
                com.zphinx.spine.unittests.impl.delegates.MultiViewTestDelegate
            </subclass>

            <managedObject>

                <objectClass>
                    com.zphinx.spine.unittests.impl.beans.SpineBean1
                </objectClass>

                <dataAccessObject>
                    <className>
                        com.zphinx.spine.unittests.impl.dao.SpineBean1DAO
                    </className>
                    <proxyIndex>1</proxyIndex>
                </dataAccessObject>
                <pageIndex>1</pageIndex>
            </managedObject>

            <managedObject>
                <objectClass>
                    com.zphinx.spine.unittests.impl.beans.SpineBean2
                </objectClass>
                <dataAccessObject>
                    <className>
                        com.zphinx.spine.unittests.impl.dao.SpineBean2DAO
                    </className>
                    <proxyIndex>2</proxyIndex>
                </dataAccessObject>
                <pageIndex>2</pageIndex>
            </managedObject>

            <managedObject>
                <objectClass>
                    com.zphinx.spine.unittests.impl.beans.SpineBean3
                </objectClass>
                <dataAccessObject>
                    <className>
                        com.zphinx.spine.unittests.impl.dao.SpineBean3DAO
                    </className>
                    <proxyIndex>2</proxyIndex>

                </dataAccessObject>
                <pageIndex>3</pageIndex>
            </managedObject>

            <builder>
                com.zphinx.spine.unittests.impl.processors.TestBuilder
            </builder>
        </multiDelegate>
    </processor>
</spine>
 
 
>
Example Application Request/Response Cycle

The application request/response cycle is demonstrated by the examples shown.  Before a call can be made, the configuration must must be informed of the objects which will be used to service the calls from a front controller. A typical application call requires the following types of objects in the order shown:

  1. DataTransferObject
  2. ViewProcessor
  3. BusinessDelegate
  4. DataProxy
  5. DataAccessObject
 The DataProxy is intrinsically tied to the DataAccessObject and the data store with all but the data store been defined in the configuration file(spine.xml).

The examples below uses a call from  a test class to the framework.  A  ViewProcessor is obtained from a ViewProcessorFactory and passed an instance of a DataTransferObject. The request is processed by the system and a ResultObject obtained. Three examples are implemented each depicting the various  possible configurations  used by the  Spine framework.The examples are:
  1. Example using a simple configuration with a single BusinessDelegate
  2. Example using a simple configuration with  multiple BusinessDelegates
  3. Example using a MultiViewProcessor configuration with a single BusinessDelegate and ManagedObjects

Example using a simple configuration with a single BusinessDelegate



This example uses the following objects:
  1. SimpleDelegateExample :- The example class for a simple delegate configuration
  2. DefaultViewProcessor:- The view processor handling the invocation
  3. SimpleDelegate:- The business delegate containing the business methods
  4. ExampleFileDAO:- The DAO which is used to access a flat file datastore.
This example shows how the request response circle instantiates and uses the objects specified in the configuration named TestProcessor. You may view these files above or by navigating to the examples directory of the distribution.

Example using a simple configuration with  multiple BusinessDelegates


This example uses the following objects:

  1. MultipleDelegatesExample :- The example class which demonstrates this spine configuration.
  2. DefaultViewProcessor:- The view processor handling the invocation.
  3. MultiDelegateExampleDelegate1:- A business delegate containing some business methods.
  4. MultiDelegateExampleDelegate2:- Another business delegate containing some business methods.
  5. MultiDelegateExampleDelegate3:- Another business delegate containing some business methods.
  6. ExampleFileDAO:- The DAO which is used to access the file datastore.
  7. ExampleDatabaseDAO:- The DAO which is used to access the  database datastore.
This example shows how the request response circle instantiates and uses the objects specified in the configuration named MultipleDelegatesExample. You may view the files used for this example above or by navigating to the examples directory of the distribution.

Example using a MultiViewProcessor configuration with a single BusinessDelegate and ManagedObjects


This example uses the following objects:

  1. MultiViewProcessorExample :- The example class which uses a MultiViewProcessor
  2. ExtendedMultiViewProcessor:- The view processor handling the invocation
  3. MultiViewExampleDelegate:- The business delegate containing the business methods
  4. Spine1DAO:- A DAO which is used to access the file datastore.
  5. Spine2DAO:- A DAO which is used to access the database datastore.
  6. Spine3DAO:- A DAO which is used to access the database datastore.
  7. SpineBean1:- A SpineBean used by this implementation.
  8. SpineBean2:- A SpineBean used by this implementation.
  9. SpineBean3:- A SpineBean used by this implementation.
  10. ExampleBuilder:-  An AbstractBuilder used by this example.
This example shows how the request response circle instantiates and uses the objects specified in the configuration named MultiViewProcessorExample. You may view these files above or by navigating to the examples directory of the distribution.
 

 
>
Example Security Usage

This example creates roles,principals and SpineBean objects for which it demonstrates the access rights which each object possesses.

This example uses the following objects:

  1. SpineSecurityExample :- The example class which is used to demonstrate spines security features.
  2. SecurityMultiViewExampleProcessor:- The view processor handling the invocation.
  3. SecurityExampleDelegate:- The business delegate containing the business methods.
  4. Spine1DAO:- A DAO which is used to access the file datastore.
  5. Spine2DAO:- A DAO which is used to access the database datastore.
  6. Spine3DAO:- A DAO which is used to access the database datastore.
  7. SpineBean1:- A SpineBean used by this implementation
  8. SpineBean2:- A SpineBean used by this implementation
  9. SpineBean3:- A SpineBean used by this implementation
  10. ExampleBuilder:-  An AbstractBuilder used by this example
This example shows how the request response circle instantiates and uses the objects specified in the configuration named SpineSecurityExample. You may view these files above or by navigating to the examples directory of the distribution.


<< Back    |     Home    |     Index    |     Forward >>

Copyright © 2008 Zphinx Software Solutions , all rights reserved