So I'm starting to look into using the EF with POCO and transfering DTO over the wire to client of my WCF.
Looks like it's a good architectural design to go with DTO instead of sending POCO over to the client.
So I was reading about it and a lot of time it mentionned using the Adapter pattern to convert the POCO to DTO.
I can't seem to find any article describing the Adapter patter used for POCO => DTO.
Can someone shed a bit of light concerning this?
Adapter is GoW pattern with exact meaning. You don't need special article to read about using it on top of POCO and DTOs (it is same like with any other classes). But I think you actually don't want a real adapter. You want something which will convert POCO to DTO and vice versa. Many developers are using very good library called AutoMapper. I usually don't use neither adapter or AutoMapper. Instead my DTO's have static methods called ToPoco
and FromPoco
- it is stupid, it is more writting but everybody understand it.