Counter icon indicating copy to clipboard operation
Counter copied to clipboard

CACountInteractor contains business rules

Open DivineDominion opened this issue 11 years ago • 2 comments

I'm talking about this part:

- (void)decrement
{
    if ([self canDecrement])
    {
        --self.count;
        [self sendCount];
    }
}

Shouldn't the Interactor delegate to a model object in the domain? I know this would be tedious since the call to increment would be delegated yet another time. But that's the deal, isn't it?

DivineDominion avatar Jun 10 '14 15:06 DivineDominion

The Interactor should contain application-dependent business logic. Entities (i.e. model objects) would contain application-independent business logic.

However, you are right to point out that it might be better to use a model object. I plan to expand this example in the future to include the use of an Entity.

jeffgilbert avatar Jul 18 '14 22:07 jeffgilbert

Please do!

chrisschreiner avatar Oct 27 '15 10:10 chrisschreiner