I'm an iOS developer and we use Core Data as our persistence framework in our app. In Core Data your domain models are classes that subclass a specific class (called NSManagedObject).
I've read chapter 25 (Testing Persistence) of GOOS and it seemed to be Customer class in that chapter is a POJO (plain old java object).
My question is this:
Does it make sense when using such persistence frameworks that require subclassing to create your own plain Customer class that doesn't inherit from anything and then to build mapping logic between your persistence class (e.g. PersistedCustomer which is a subclass of NSManagedObject) and your application domain class (Customer)?
Or if your PersistedCustomer happens to have the interface you actually want, perhaps have Customer be an interface that PersistedCustomer implements? With this approach would tests that use Customer then create a mock customer (since it's an interface)? Does it matter you're not creating concrete Customer objects in tests? Obviously you wouldn't want your business logic tests to be instantiating PersistedCustomer objects since that requires you to bring in the entire persistence framework into your tests. Another approach here would be to create an implementation of the Customer interface that's only used for tests, but it seems strange to create a class like that specifically for tests.