News for hackers. Stuff that matters.
Re:Cyclic dependencies are evil (2013) by monocasa on Saturday January 30, 2021 @01:25PM (#25971490)
You would forget everything about a customer if they closed their last account?
Re:Cyclic dependencies are evil (2013) by Smaug123 on Saturday January 30, 2021 @01:33PM (#25971570)
No, of course you would maintain a Set<Customer> as well (possibly even a Map<Customer, Account Set> for efficiency).
Re:Cyclic dependencies are evil (2013) by ImprobableTruth on Saturday January 30, 2021 @02:00PM (#25971865)
... 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.
Re:Cyclic dependencies are evil (2013) by monocasa on Saturday January 30, 2021 @01:45PM (#25971703)
Their 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.