Modeling and Responsibility

Suppose you want to create a bank account model in your application. You can create a BankAccount class that does what a typical bank account does. But if you are asked what is the responsibility of the class, what is the answer? "Behavior as a bank account?" This is not very specific. I am a little confused by the relationship between model and responsibility. Many real-world objects do not seem to have a clear responsibility.

What is the best way to start modeling such concepts and keep clearly defined responsibilities?

+5
source share
6 answers

, " ". , :

  • ,
  • -, ( ).
  • ,
  • , ( - , )
  • ( ) .
  • ,
  • , .
  • .
  • ..

() () , . ", ", ", ", ", , ", ..

, , , Agile. Agile kool-aid, ; , . , , , .

+5

, :

  • .
+1

, .

- , , , .

, , , . , , . , "" .

, , , ? , .

, - . , , .

, , .

, .

+1

"... " ", , ..."

, , . , , . , . , . "" , .

. .

, . .

0

, koen, , , , .

, . , . , , - . . , :

, , . .

0

. ( ):

( ) :

  • ? ? ? ( )

  • ?

  • ?

  • , ?

(..) /. . / .

, , , ( , , - ..)

" - . , ".

/ , / . (, ), .

- , , - , . , .

,

  • -
    • can issue a check from his account
    • may transfer amounts to other accounts.
    • can pay bills.
    • can get his salary credited to the account
    • can get overdrafts
  • Belongs to a jar that may
    • Use your account as a tool to track cash and account transactions.
    • stores and maintains all information about the account and money.
    • restricts access to the account holder and ensures the security of their money.
    • and etc.


amuses
-sundar

0
source

All Articles