Timeline for Circular dependency exists logically or physically and can be it broken with IDs?
Current License: CC BY-SA 4.0
18 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Jun 16, 2020 at 10:01 | history | edited | CommunityBot | Commonmark migration | |
| Aug 1, 2019 at 12:25 | vote | accept | keelerjr12 | ||
| Nov 12, 2018 at 19:37 | answer | added | JimmyJames | timeline score: 2 | |
| Nov 12, 2018 at 19:25 | comment | added | keelerjr12 | @JimmyJames, I undestand that. Instead of having the relation A <-> B, in this case, am I missing an abstraction that allows something like A -> C <- B that prevents this circular dependency? What I'm asking is how to solve this by introducing a C object or even using IDs vs actual pointers. | |
| Nov 12, 2018 at 19:24 | comment | added | JimmyJames | So is there a reason you don't want to provide the clarification I have asked for? In order to call a method on a B object, you need a reference to that object. It therefore makes no sense to say you need that method there in order to know which B to remove. If you didn't know which B you were removing, how would you call a method on it? | |
| Nov 12, 2018 at 19:21 | comment | added | keelerjr12 | @JimmyJames, I'm asking. | |
| Nov 12, 2018 at 19:21 | comment | added | JimmyJames | Are you asking or telling? I don't have a question about this. I thought you did. | |
| Nov 12, 2018 at 19:20 | comment | added | keelerjr12 | @JimmyJames, from my research it seems common to break circular dependencies by introducing a 3rd object (Reference here). Or alternatively, simplifying the domain with Value Objects. However, in my case, I'm having trouble introducing another abstraction to solve this problem. | |
| Nov 12, 2018 at 19:18 | comment | added | JimmyJames | I get that. What I don't get is the specific statement I quoted. | |
| Nov 12, 2018 at 19:17 | comment | added | keelerjr12 | @JimmyJames, the issue I'm having is that an Account has a list of Transactions, but Transaction is tied to multiple accounts. This creates a huge circular dependency and I'm having trouble breaking it. Account -> List of Transactions -> Multiple Accounts -> List of Transactions -> Multiple Accounts -> etc. | |
| Nov 12, 2018 at 19:15 | comment | added | JimmyJames | "I'm trying to wrap my head around solving this with a 3rd object or using value objects, but a use-case would be to delete a B from A (so I need to know which B to delete (i.e. have an identity))." You have to have a reference to B in order to call a method on it. I'm a little confused about the challenge you are seeing here. Can you elaborate? | |
| Nov 12, 2018 at 19:09 | history | edited | keelerjr12 | CC BY-SA 4.0 | added 67 characters in body |
| Nov 12, 2018 at 19:09 | comment | added | keelerjr12 | A would be an account and B would be a transaction. | |
| Nov 12, 2018 at 19:08 | comment | added | Dan Pichelman | To clarify, B is a transaction (e.g., Salary) and A is a line item in your split (e.g., Expenses:Taxes:Federal)? | |
| Nov 12, 2018 at 18:39 | comment | added | keelerjr12 | @JimmyJames, fixed. | |
| Nov 12, 2018 at 18:39 | history | edited | keelerjr12 | CC BY-SA 4.0 | added 379 characters in body |
| Nov 12, 2018 at 18:26 | comment | added | JimmyJames | You give some information about A needing to know about B but you don't explain why B needs to know about A. You should probably add that. | |
| Nov 12, 2018 at 16:32 | history | asked | keelerjr12 | CC BY-SA 4.0 |