Timeline for What is the benefit to having pure POCO models?
Current License: CC BY-SA 3.0
5 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 5, 2017 at 17:10 | comment | added | John M Gant | @Casey, you won't get any argument from me about that. But I wouldn't argue if somebody wanted to use it either. Main point was if Jesse did intend to use a pattern like Active Record that integrates persistence with model definition, he would have all the problems CandiedOrange highlights, and wouldn't really qualify as a POCO, for what that's worth. But that's not what he's doing anyway. | |
Jun 5, 2017 at 17:04 | comment | added | Casey | I think Active Record is just a bad pattern. | |
Jun 5, 2017 at 16:19 | comment | added | John M Gant | Thanks for explaining. Yeah, that sounds like exactly the type of behavior that should be in a POCO, and definitely better than just exposing your underlying IEnumerable for callers to modify or replace at will. | |
Jun 5, 2017 at 16:04 | comment | added | Jesse | Really the AddChild is just checking for duplication, and null, and not allowing either. RemoveChild is there because to prevent backdoor adds the collection is exposed as an IEnumerable. It would only perform the standard remove from the collection though. | |
Jun 5, 2017 at 15:10 | history | answered | John M Gant | CC BY-SA 3.0 |