Hello Adam,
Wednesday, July 18, 2001, 8:51:58 PM, you wrote:
AY> This sounds like the pipeline/chain setup from ATG. My one concern is
AY> that you will end up with convoluted processing logic in the xml.
Main idea is to describe commands in XML and let to manipulate such
blocks without code recompilation.
AY> Iwould recomend that this type of processing stay in the java code. I
AY> also would be a little wary of the SQL code migrating into the XML.
Why? It can be useful for small projects with insert/update/delete
logic only.
AY> If this is related to the idea of chaining actions we talked about
AY> before, it may be better to provide an API inside of the Action object
AY> Forward to another action. Although What I would like to see is the
AY> ability of a Action object to take a collection of Form's. While I
AY> typically would use two (The previopus pages form and the next pages
AY> form) I could see needing another.
AY> Oleg V Alexeev wrote:
>>Hello struts-dev,
>>
>> This day I start to build new service for ServiceManager -
>> CommandService. It would be based on FactoryService (early published
>> as BeanFactory).
>>
>> FactoryService (as BeanFactory) build on base of Abstract Factory
>> pattern. So its idea is to generate beans and store it to the some
>> context. Now I found such approach as limited.
>>
>> CommandService idea is based on Command pattern. There are two
>> entity types on playground - Command and Processor. Processor's
>> missing is to perform Command and prepare predefined count of result
>> objects. Every action can contain list of calls to the Processors
>> with appropriate Commands. The most simple way to pass results from
>> on Porcessor to another is to perfom processing and store result in
>> some context (request, session, etc.). More flexible way is to
>> write nested calls to the Processors with appropriate Commands. And
>> generally all this stuff (set of Processors and
>> Commands) can be used to build some kind of scripting in
>> struts-config.xml with BSF framework.
>>
>> Example of service manager config in struts-config -
>>
>> <service-manager>
>> <process-registrations>
>> <process-registration name="preprocess"/>
>> </process-registrations>
>> <service-registrations>
>> <service-registration
>> name="command"
>> type="org.apache.struts.service.command.CommandService"
>> useDigester="true">
>> <command-service>
>> <processors>
>> <processor name="jdbcUpdate" type="some.package.Class">
>> <result
>> name="totalUpdated"
>> type="java.lang.Integer"/>
>> </processor>
>> </processors>
>> <commands>
>> <command
>> name="createUser"
>> command="insert into rb.user( name ) values ( ? )">
>> <processors>
>> <processor name="jdbcUpdate"/>
>> </processors>
>> <parameter
>> name="method"
>> type="java.lang.String"
>> value="preparedStatement"/>
>> <parameter
>> name="userName"
>> type="java.lang.String"/>
>> </command>
>> </commands>
>> </command-service>
>> </service-registrations>
>> </service-manager>
>>
>> <action-mappings>
>> <action path="/user/insert"
>> type="some.package.Action"
>> name="userForm"
>> input="/WEB-INF/jsp/userEdit.jsp">
>> <perform-command name="createUser"/>
>> <forward name="success" path="/WEB-INF/jsp/userList.jsp"/>
>> </action>
>> </action-mappings>
>>
>>
>>
--
Best regards,
Oleg mailto:[EMAIL PROTECTED]