In many of the projects I have worked on, we often have many classes that display content from one domain model to another. For example, from the created WSDL model for a specific project.
eg
public class FooBarContentMapper { public static Foo fromWsToDomain(FooType fooType) { ... } }
it can also be a non-static method, and the service level can have a mapper object field instead of calling a static method:
public class FooBarContentMapper { public Foo fromWsToDomain(FooType fooType) { ... } }
I believe that both methods are used a lot, but:
- is one solution more efficient in any way?
- Are any of the solutions considered best practice?
source share