Timeline for How would you model an objects representing different phases of an entity life cycle?
Current License: CC BY-SA 3.0
5 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Nov 12, 2013 at 14:48 | comment | added | 9000 | Since you maintain a link to a previous object, all data from all previous steps are available. Probably you don't (usually) need all of them on a given step, so you might want to copy only the few often-used fields. (I see how it sounds arbitrary, though.) What you copy remains an implementation detail, so it's easy to adjust without refactoring and even major rebuilding. | |
| Nov 12, 2013 at 14:37 | comment | added | Ophir Yoktan | The various 'create loan from loan application' methods will be a pretty long list of field assignments. and it's easy to miss a field. | |
| Nov 12, 2013 at 14:30 | comment | added | 9000 | Which kind of code do you suspect will be hard to maintain? Note that all the state-modification code becomes new-instance-construction code, which is usually more straightforward. Copying allows you to forget where a piece of data originated and avoid chain lookups as long as you only need the latest ('current') state. What am I missing? | |
| Nov 12, 2013 at 6:22 | comment | added | Ophir Yoktan | "Where it is cheap, I'd copy data from the previous phase": my main concern is not data storage or computation efficiency, but the copying code which tends to be hard to maintain. From other aspects it appears a good solution. | |
| Nov 11, 2013 at 20:55 | history | answered | 9000 | CC BY-SA 3.0 |