Following Marin Fowler's first law on distributed objects:
My First Law of Distributed Object Design: Don't distribute your objects
This is the typical setup I used when working with Web API solutions:
The problem is that there is a lot of replication as the entities, pocos and models look almost the same, the exception being the models which might contain serialization attributes. This has always worked fine and libraries such as valueInjecter make the conversion between types trivial, but nevertheless it is complicated to argue of even justify to other people the reasoning behind this. One might argue that the models might be different from a table structure and although that might be true, most of the times the models map directly to the entities/pocos.
That said, would you use a shared library and have a single type only?
Thanks.
Aucun commentaire:
Enregistrer un commentaire