Languages :: General :: OOD - How do you treat a word that is a Noun and also a Verb |
|||
| By: thepreacher |
Date: 07/06/2009 03:09:24 |
Points: 20 | Status: Answered Quality : Excellent |
|
I new to OOP and am currently trying to redesign a legacy Money transfer program. I am stuck trying to decide how to classify or treat the word Transfer . Its a Noun and also a Verb. I learned that Noun is a Object and Verb is a Method.Eg. Customer transfers money to a recipient through MTC (the money transfer company) and recipient collects the money from a partner bank. I will say the objects are Customer, Recipient, MTC, Transfer and Bank? However Transfer is also a process ie.Customer gives money to MTC MTC accepts money and gives a reciept to customer Customer notifies recipient Recipient goes to Bank and collects money etc... Is my analysis above correct? Basically when you have a noun that is also a verb how do you handle it in an OOP design. Are there any special considerations? Hope you get my question. |
|||
| By: VGR | Date: 07/06/2009 19:04:15 | Type : Answer |
|
| I would not say that noun=object and verb=method ; I would say that your entities are Customer, MTC, Recipient, Bank. Given those entities would become tables, I guess that your objects are the same. I would say that "give money", "give receipt", "notify recipient" and "collect money" are probably to become methods, but are more actions or data flows (ie, relationships) between entities. IMHO starting from entities and relationships you can have different object types (classes) derived from a single one (Customer, Bank, Recipient all have "human" profiles for instance, ie postal address, name and surname/company name, etc), thus I would not say that entities=objects ; the OO model has to be thinked over from the entities/relationships model. |
|||
|
Do register to be able to answer |
|||
©2010 These pages are served without commercial sponsorship. (No popup ads, etc...). Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE.
Please DO link to this page!








