SOOlutions / HomeTaskApp

True OO implementation in Java of a Home Task Management System. This project is a port and modification from https://github.com/SilasReinagel/HomeTaskManagement
2 stars 1 forks source link

Account Overdraft can be enabled or disabled #4

Open SilasReinagel opened 6 years ago

SilasReinagel commented 6 years ago

Account should have Overdrafts disabled by default. If Overdrafting is disabled, the Account Balance should never drop below 0. If Overdrafting is enabled, the Account Balance can be any value. A user should be able to enable Overdrafting. A user should not be able to disable Overdrafting while he has a negative balance.

vivekimsit commented 6 years ago

This counts as business case or application logic, right?

SilasReinagel commented 6 years ago

@vivekimsit What is "application logic"? Does such a thing exist?

vivekimsit commented 6 years ago

From my experience we try to separate object's core behaviour, are these core behaviours of the objects?

SilasReinagel commented 6 years ago

Depends on how it is architected. If an Object makes his own decisions, then it would seem to be a core trait of the Account himself.

Wouldn't separating out various behaviors of an Account and putting them elsewhere de-objectify the Account?

vivekimsit commented 6 years ago

Yes, that was more of a question than answer from me, understanding this thing is most important for me because I get confused where to draw that boundary i.e. how much behaviour should go into an object?

goqp commented 6 years ago

This is what i meant about abstracting the architecture from the object. Right now, the behavior that falls within the domain of an object (account type stuff) needs to be done by some kind of an account. If the behavior is less core than it should go into a decorator.

goqp commented 6 years ago

The architecture / business logic is inside the ticket and needs to come out.

Ticket a. Account

  1. Account should be able to add and remove policies (for example, can overdraft).
  2. Only authorized users can add a given policy.

Ticket b. Business logic

  1. Account should have Overdrafts disabled by default.
  2. If Overdrafting is disabled, the Account Balance should never drop below 0.
  3. If Overdrafting is enabled, the Account Balance can be any value.
  4. A user should be able to enable Overdrafting.
  5. A user should not be able to disable Overdrafting while he has a negative balance.
SilasReinagel commented 6 years ago

This can be modelled as Account having Policies. You can break this into two tickets if needed.