Plain Old CLR Object vs Data Transfer Object

后端 未结 10 1562
挽巷
挽巷 2020-11-22 13:38

POCO = Plain Old CLR (or better: Class) Object

DTO = Data Transfer Object

In this post there is a difference, but frankly most of the blogs I read describe P

10条回答
  •  攒了一身酷
    2020-11-22 14:24

    Don't even call them DTOs. They're called Models....Period. Models never have behavior. I don't know who came up with this dumb term DTO but it must be a .NET thing is all I can figure. Think of view models in MVC, same dam** thing, models are used to transfer state between layers server side or over the wire period, they are all models. Properties with data. These are models you pass ove the wire. Models, Models Models. That's it.

    I wish the stupid term DTO would go away from our vocabulary.

提交回复
热议问题