• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

generic or specific input object model design

 
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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,
reply
    Bookmark Topic Watch Topic
  • New Topic