Coding TableFlip: the Bigger Picture

Now that TableFlip is nearing completion, I want to share details of how I created this piece of software with you. Today, I’ll start with the bigger picture: the application architecture. Earlier this year, I got to know ReSwift from a talk by Benjamin Encz which I loved.
3 Ways to Model Relationships in a Domain
Let’s assume we need a Domain Model and can’t create our application with basic CRUD actions and data containers. Let’s further assume we have a Box
Entity which can contain many Item
n. Item
is an Entity, too, because its attributes may change over time, so a Value Object won’t do.
Use Double-Dispatch and Polymorphism to Get Rid of Conditionals
I want to point out a particular refactoring Jimmy Bogard shows in his video I mentioned last time. Jimmy transforms a switch
statement into a double-dispatch method call, making use of good old polymorphism to deal with variety of options. We’ll see what these terms mean when applied.
Crafting Wicked Domain Models by Jimmy Bogard

When we create applications and the business logic becomes more complex, it might be a good idea to focus on moving business logic into the Domain Model intentionally. If you don’t do this, business logic will likely bleed into view controllers. Good luck finding the scattered remains when you need to perform changes!