Class Design for special business rules
Posted
by
Samuel Front
on Programmers
See other posts from Programmers
or by Samuel Front
Published on 2013-09-04T08:32:59Z
Indexed on
2013/11/03
22:16 UTC
Read the original article
Hit count: 319
I'm developing an application that allows people to place custom manufacturing orders. However, while most require similar paperwork, some of them have custom paperwork that only they require. My current class design has a Manufacturer class, of which of one of the member variables is an array of RequiredSubmission objects.
However, there are two issues that I am somewhat concerned about.
First, some manufacturers are willing to accept either a standard form or their own custom form. I'm thinking of storing this in the RequiredSubmission object, with an array of alternate forms that are a valid substitute. I'm not sure that this is ideal, however.
The major issue, however, is that some manufacturers have deadline cycles. For example, forms A, B and C have to be delivered by January 1, while payment must be rendered by January 10. If you miss those, you'll have to wait until the next cycle. I'm not exactly sure how I can get this to work with my existing classes—how can I say "this set of dates all belong to the same cycle, with date A for form A, date B for form B, etc."
I would greatly appreciate any insights on how to best design these classes.
© Programmers or respective owner