tag:blogger.com,1999:blog-7806605514179331942.post8839965353702055980..comments2023-09-08T01:45:44.128-07:00Comments on Ramblings from Rhys: Models incAnonymoushttp://www.blogger.com/profile/05255012174375838982noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7806605514179331942.post-31361361326206825032009-05-01T07:02:00.000-07:002009-05-01T07:02:00.000-07:00Good post.
It is amazing how lazy we can get isn't...Good post.<br />It is amazing how lazy we can get isn't it. The thought of having to write some code regardless of how trival it is just scares people off. So we fall in to the area of Coincidental reuse. This is where "models" <I>are</I> the DTOs and are <I>also</I> used on the client (WPF). So we have mega classes that exhibit multiple personality disorder as the implement interfaces for WPF, WCF and possibly ORM. As Rico Mariani (http://blogs.msdn.com/ricom) puts it "Reusable? ...but it was never useable. How can it be <I>RE</I>-useable?"<br /><br />Sure there is a pain in the butt part of writing some translators that almost always just look like<br />target.Id = source.Id;<br />target.Name = source.Name;...etc<br />but how much easier is it for everyone else to work with WPF objects that are specifi to their cause and dont have wierd and wonderfull properties that you are not sure if you can/should set them.<br /><br />They only people you will get argueing against your post are the guys who have to write the translators (eh G.Fox) or permies who "know the code base inside & out". Obvisouly they dont care that no-one else can read the garbage code or that changing something for WPF may break something in the WCF or ORM layer.<br /><br />While im commenting, my favoured naming convention is<br /><B>CustomerSummary</B>and then just plain old<br /><B>Customer</B>for the detailed version. I also prefer it if the CustomerSummary is immutable if it will only be displayed in lists.Lee Campbellhttps://www.blogger.com/profile/16932445715757919177noreply@blogger.com