5 ms·
Don't put anything in your model code This is a SERIOUS code smell in my opinion. You want business logic in your model layer. That's where it belongs. A good
by cageface 12y ago
Don't put anything in your model code
This is a SERIOUS code smell in my opinion. You want business logic in your model layer. That's where it belongs. A good persistence layer does not dictate model design.
- taeric 12y agoI think the idea is that this is your persistence model, not necessarily your business model. Often attempts are made to combine these. I feel it is also often that these attempts lead to pain. (And, judging by this blog, I'm not alone. Unless, of course, I'm mistaken.)
- shadesandcolour 12y ago"Model code" in that sentence refers purely to NSManagedObject subclasses. Create other model objects to work with your entities instead of asking them to do things for you. How much business logic belongs in the class that models a tweet?
- sivanmz 12y ago> Create other model objects to work with your entities instead of asking them to do things for you. Regardless of persistence, using such "manager" objects to operate on data records is procedural rather than object oriented programming.