visitor (0 QPoints)
  • FR
  • EN
  • NL
  • DE
  • ES
315 experts, 1193 registered users, 1659 questions already answered
European Experts Exchange, the very best site for high-quality IT solutions

New Improved Search!

 


05/10/2011 1h30 : Steve Jobs is dead, the father of Apple ][ is gone, we are all orphaned.

Languages :: General :: OOD - How do you treat a word that is a Noun and also a Verb


By: thepreacher Great Britain  Date: 07/06/2009 03:09:24  English  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 English  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

EContact
browser fav
page generated in 289.154050 milliseconds

Why Google AdSense ads ?

compteur
 Ranking-Hits PageRank for this page