Re: sale.submit() or submitter.submit(sale)
- From: "H. S. Lahman" <hsl@xxxxxxxxxxxxxxxxx>
- Date: Mon, 28 Jan 2008 15:53:17 GMT
Responding to Greatlord_5...
There are several different kinds of sales, such as OTCSale, WebSale,
PhoneSale and so on. They are different enough to merit different
classes. However, they are submitted to the mainframe in more or less
the same way.
My question is this:
Should the sale object have a submit operation in it? Or should there
be a separate Submitter class which accepts different kinds of sale
objects?
That depends on what is involved in submitting. If all the submit does is package the object's <unique set of> attributes into a data packet to send to the server, you first choice is fine because the differences are tied to the nature of the Sale object.
OTOH, if the submit needs to work through some exotic network protocol and/or the formatting issues are complicated (e.g., breaking up message packets), then that sort of thing does not logically belong to a sale. So you would likely delegate that to another class. In that case, if the individual submit processing was different for each type of sale you might look at the GoF Strategy pattern for that delegation.
--
There is nothing wrong with me that could
not be cured by a capful of Drano.
H. S. Lahman
hsl@xxxxxxxxxxxxxxxxx
Pathfinder Solutions
http://www.pathfindermda.com
blog: http://pathfinderpeople.blogs.com/hslahman
"Model-Based Translation: The Next Step in Agile Development". Email
info@xxxxxxxxxxxxxxxxx for your copy.
Pathfinder is hiring: http://www.pathfindermda.com/about_us/careers_pos3.php.
(888)OOA-PATH
.
- References:
- sale.submit() or submitter.submit(sale)
- From: greatlord_5
- sale.submit() or submitter.submit(sale)
- Prev by Date: Re: Business objects, subset of collection
- Next by Date: CFP: DATICS 2008 - Design, Analysis and Tools for Integrated Circuits and Systems
- Previous by thread: Re: sale.submit() or submitter.submit(sale)
- Next by thread: Use case and API
- Index(es):
Relevant Pages
|