All,
I am currently working on the input object model design for an insurance client. The insurance cover could be Auto, Farm or Workers Compensation (WC).
Most of the policy attributes remain the same but each business type will have a some specific input attributes not relevant to others.
The idea is to create a
java based invocation layer exposing operation to trigger the business logic. My question is should I go for one generic operation and have the input parameter created in a manner that can accept all attributes or should I break the operations per business type and create different objects which would be used as the input for each such operation.
Per the generic approach I would have one operation exposed accepting one main InsuranceInputRequest object which internally would contain AutoInput, FarmInput and WCInput objects plus the common attributes contained at the top level. Based on the business type field (A,F,WC) which is an attribute of the InsuranceInput object, the business logic would fetch the corresponding businessObject (AutoInput or FarmInput or WCInput) and go ahead with the processing accordingly.
The other option is to create separate operations for each business type (operAuto, operFarm, operWC) each accepting a specific input type (autoInput, farmInput, wcInput).
The client wants to have one operation exposed for all interactions flowing in from calling apps but we want to evaluate the pros/cons of each beforehand.
Let me know your thoughts on the 2 approaches.
Thanks,