Question

Would NSSortDescriptor subclasses be placed in the Model or the Controller layer?

Since they are primarily for display and business logic, it seems to make sense to put them in the Controller layer. But it also makes sense that models should know how to sort themselves.

Was it helpful?

Solution

NSSortDescriptor… subclasses?

models should know how to sort themselves.

Sorting is a presentation-to-the-user issue, which makes it more the domain of views and controllers; models generally should stay out of such things.

In Cocoa, you instantiate NSSortDescriptor, and you keep these descriptors in an array, to be used by whatever wants to sort things with them. I cannot think of a reason to subclass NSSortDescriptor.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top