3 ms·
You would forget everything about a customer if they closed their last account?
by monocasa 6y ago
You would forget everything about a customer if they closed their last account?
- Smaug123 6y agoNo, of course you would maintain a Set<Customer> as well (possibly even a Map<Customer, Account Set> for efficiency).
- monocasa 6y agoTheir whole premise is that > Customers rely on Accounts (I.e. have one or many). I'm giving a domain relevant counter example to that premise. And interestingly enough, that leads you to a clean way of modeling it without the cyclic dependency as you've just done.
- ImprobableTruth 6y ago... if you model it that way you're not using cyclic dependencies at all and this is in fact exactly how you would model it in a functional way.