I am trying to extract class and behavior of the class by using noun and verb analysis,the requirement statement is as follows:
The dealer submits the order.
There are two nouns (dealer,order) and one verb (submit)
I can determine the classes (dealer,order) easily, but i don't know how to determine which class to give the behavior:
dealer.submit(order)
or order.submit(dealer)
Is there any available principle or methodology to determine of behavior (responsibility) of the class when using noun-verb approach?
If you're just answering a homework question, "the dealer submits the order" translates into dealer.submit(order). The subject of the sentence is doing the action on the object of the sentence.
If you're actually doing some design, create some quick CRC cards (or something similar) to determine how dealer, order, and factory all interact. Can you send the same order to different dealers or is an order dealer-specific? Are there multiple factories? Does the dealer do anything with the order before sending it to the factory?
If you're actually writing code, write some tests. Actually use the code before you implement the logic.