<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8101338433170556648</id><updated>2011-11-27T15:34:38.965-08:00</updated><category term='SOLID'/><category term='Unit testing'/><category term='Complexity'/><category term='Microsoft'/><category term='select'/><category term='Performance'/><category term='pride'/><category term='SQL'/><category term='personal'/><category term='best'/><category term='carrer'/><category term='Cohesion'/><category term='OOD'/><category term='Server'/><category term='where'/><category term='UML'/><category term='expression'/><category term='Inversion of Control'/><category term='lambda'/><category term='Single Responsibility'/><category term='AdventureWorks'/><category term='HierarchyId'/><category term='Professional'/><category term='Coupling'/><category term='query'/><category term='C#'/><category term='inheritance'/><category term='Development'/><category term='job'/><category term='TDD'/><category term='Windows Workflow Foundation Dependency Properties Microsoft .NET C#'/><category term='software'/><category term='Linq'/><category term='practices'/><category term='ORM'/><category term='Debugging'/><category term='design'/><category term='DBA'/><category term='IOC'/><category term='modeling'/><category term='Object Oriented Design'/><category term='work'/><category term='database inheritance modeling'/><category term='brand'/><category term='.NET'/><category term='database'/><title type='text'>Big Fish Solutions</title><subtitle type='html'>Welcome to Big Fish Solutions.  Solutions tailored with the perfect blend of people, process, and technology.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>11</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-2506709503425915453</id><published>2011-07-27T07:05:00.000-07:00</published><updated>2011-07-27T07:05:55.819-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Coupling'/><category scheme='http://www.blogger.com/atom/ns#' term='Cohesion'/><category scheme='http://www.blogger.com/atom/ns#' term='Single Responsibility'/><category scheme='http://www.blogger.com/atom/ns#' term='IOC'/><category scheme='http://www.blogger.com/atom/ns#' term='Inversion of Control'/><category scheme='http://www.blogger.com/atom/ns#' term='OOD'/><category scheme='http://www.blogger.com/atom/ns#' term='SOLID'/><category scheme='http://www.blogger.com/atom/ns#' term='Object Oriented Design'/><title type='text'>Decoupling classes for user interfaces</title><content type='html'>Someone recently asked the following question on Stack Exchange:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;What is the best practice when it comes to writing classes that might have to know about the user interface. Wouldn't a class knowing how to draw itself break some best practices since it depends on what the user interface is (console, GUI, etc)?&lt;br /&gt;&lt;br /&gt;In many programming books I've come across the "Shape" example that shows inheritance. The base class shape has a draw() method that each shape such as a circle and square override. This allows for polymorphism. But isn't the draw() method very much dependent on what the user interface is? If we write this class for say, Win Forms, then we cannot re-use it for a console app or web app. Is this correct?&lt;br /&gt;&lt;br /&gt;The reason for the question is that I find myself always getting stuck and hung up on how to generalize classes so they are most useful. This is actually working against me and I'm wondering if I'm "trying too hard".&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;My answer was as follows:&lt;br /&gt;&lt;br /&gt;There are a number of tried and true design patterns that have been developed over the years to address exactly what you are talking about. Other answers to your question have referred to the Single Reponsibility Principle - which is absolutely valid - and what seems to be driving your question. That principle simply states that a class needs to do one thing WELL. In other words raising Cohesion and lowering Coupling which is what good object oriented design is all about - does a class do one thing well, and not have a lot of dependencies on others.&lt;br /&gt;&lt;br /&gt;Well...you are right in observing that if you want to draw a circle on an iPhone, it will be different than drawing one on a PC running windows. You MUST have (in this case) a concrete class that draws one well on the iPhone, and another that draws one well on a PC. This is where the basic OO tenent of inheritance that all of those shapes examples breaks down. You simply cannot do it with inheritance alone.&lt;br /&gt;&lt;br /&gt;That is where interfaces come in - as the Gang of Four book states (MUST READ) - Always favor implementation over inheritance. In other words, use interfaces to piece together an architecture that can perform various functions in many ways without relying on hard coded dependencies. &lt;br /&gt;&lt;br /&gt;I've seen referece to the SOLID principles. Those are great. The 'S' is the single responsiblity principle. BUT, the 'D' stands for Dependency Inversion. The Inversion of Control pattern (Dependency Injection) can be used here. It is very powerful and can be used to answer the question of how to architect a system that can draw a circle for an iPhone as well as one for the PC. &lt;br /&gt;&lt;br /&gt;It is possible to create an architecture that contains common business rules and data access, but have various implementations of user interfaces using these constructs. It really helps, however, to have actually been on a team that implemented it and see it in action to really understand it. &lt;br /&gt;&lt;br /&gt;This is just a quick high-level answer to a question that deserves a more detailed answer. I encourage you to look further into these patterns. Some more concrete implementation of these patters can be found as well known names of MVC and MVVM.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-2506709503425915453?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/2506709503425915453/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2011/07/decoupling-classes-for-user-interfaces.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/2506709503425915453'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/2506709503425915453'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2011/07/decoupling-classes-for-user-interfaces.html' title='Decoupling classes for user interfaces'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-5743714979228690427</id><published>2011-04-21T07:08:00.000-07:00</published><updated>2011-04-21T07:11:09.738-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='Unit testing'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='Debugging'/><category scheme='http://www.blogger.com/atom/ns#' term='TDD'/><title type='text'>Unit Testing a Waste of Time?</title><content type='html'>A Linked-In user recently posted the following question:&lt;br /&gt;&lt;br /&gt;How much time do you spend debugging?  How much time do you spend dealing with software bugs? Is debugging something that bothers you and wastes your time, or not much of a concern?&lt;br /&gt;&lt;br /&gt;Well, I have to admit I'm VERY anal when it comes to unit testing code, and am just as vehement (OK...sometimes a jerk) when it comes to my teams regarding unit testing before it gets sent out. I have known some developers who make a quick change and then check their code in before even running it through a "smoke test". They feel like the change is too minimal, or it is so minor that "nothing can break from this"...well...we all know what ASSUME means (ASS-U-ME). &lt;br /&gt;&lt;br /&gt;I am NOT a TDD biggot. But, I truly think that the time spent up front to go through as many possible scenarios as possible (and more) will pay big dividends in the long run. Yes, I admit that I don't code as quickly as some because of that, but for the most part, I'm not going back a month later fixing some stupid bug that reared its ugly head because I was careless. &lt;br /&gt;&lt;br /&gt;Regarding the question - "does it bother me or waste my time?" - absolutely not...that is part of the job, and if a developer doesn't like that part, then they may need to re-evaluate their line of work. Debugging is part of coding - part of the solution finding. And ultimately, when we DO find the solution - one of the sources of satisfaction behind our craft.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-5743714979228690427?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/5743714979228690427/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2011/04/unit-testing-waste-of-time.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/5743714979228690427'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/5743714979228690427'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2011/04/unit-testing-waste-of-time.html' title='Unit Testing a Waste of Time?'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-7706862507309402398</id><published>2010-12-09T16:22:00.001-08:00</published><updated>2010-12-09T16:23:02.095-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Development'/><category scheme='http://www.blogger.com/atom/ns#' term='DBA'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><category scheme='http://www.blogger.com/atom/ns#' term='Performance'/><category scheme='http://www.blogger.com/atom/ns#' term='ORM'/><title type='text'>ORM or SQL for real world project</title><content type='html'>Just answered a question on Linked-In regarding ORM vs. SQL for real world projects...here is my answer:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OK...Since I'm a consultant, I'll give you the consultant answer - "It depends".  &lt;br /&gt;&lt;br /&gt;Using an ORM such as Entity Framework makes it VERY easy to run CRUD routines against a database without having to do ANY stored procedures (or any other SQL for that matter).  What you lose when you do that is the ability to fine tune the queries or have a lot of control of what the ORM will generate.  Oh, yea...I know some will argue that you have a lot more control, but bottom line the tool is still generating SQL for you to perform that operation.  A lot of DBAs don't like that because they too lose some control of what is actually happening on the database and the SQL being generated.  &lt;br /&gt;&lt;br /&gt;Managers love it because productivity is ramped up because we aren't generating a lot of SPROCs and other object code that takes time and has to be maintained.&lt;br /&gt;&lt;br /&gt;You hit it on the money that if you want to go with the SQL approach, you will gain some performance because you lose a layer in the ORM, and have the ability to fine tune your queries - as well as them living on the DB server.  BUT...you lose some productivity because now you need to generate those CRUD procedures as well as create the business layer around them.  Using a tool like MyGeneration can mitigate that some, but you still have code to maintain.  &lt;br /&gt;&lt;br /&gt;Bottom line, if HIGH performance is an issue, then I would stick to the old fashion, tried-and-true SPROCs and associated objects layers.  However, for most real-world line-of-business applications where you have a few dozen or a few hundred users and a "normal" level of performance is expected, then I would take advantage of the productivity enhancements gained by the ORMs.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-7706862507309402398?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/7706862507309402398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2010/12/orm-or-sql-for-real-world-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/7706862507309402398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/7706862507309402398'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2010/12/orm-or-sql-for-real-world-project.html' title='ORM or SQL for real world project'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-429348995608113588</id><published>2009-07-27T05:58:00.001-07:00</published><updated>2009-07-27T06:03:44.849-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='practices'/><category scheme='http://www.blogger.com/atom/ns#' term='personal'/><category scheme='http://www.blogger.com/atom/ns#' term='Professional'/><category scheme='http://www.blogger.com/atom/ns#' term='best'/><category scheme='http://www.blogger.com/atom/ns#' term='brand'/><title type='text'>Best Practices and your "Personal Brand"</title><content type='html'>OK...I cannot take credit for this.  It comes from &lt;a href="http://www.hanselman.com/blog/"&gt;Scott Hanselman's blog&lt;/a&gt;.  I really liked it and wanted to post it here for easy linking/viewing.&lt;br /&gt;&lt;br /&gt;Hanselman's original post is &lt;a href="http://www.hanselman.com/blog/CommentView.aspx?guid=BC4CB1ED-F855-4594-911C-1D815918C949#acc1f559-511f-4899-8c71-9782dee6c3e4"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Consciously manage your &lt;/strong&gt;&lt;a href="http://www.hanselman.com/blog/BlogInteresting32WaysToKeepYourBlogFromSucking.aspx"&gt;&lt;strong&gt;personal brand&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;br /&gt;You work here to help the company, but also yourself. No one will manage your “personal brand” except you. How are you perceived? Do you know? Take negative feedback gracefully, and implement change. Rinse, repeat.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Push the Limits&lt;/strong&gt;&lt;br /&gt;Chris Sells told me once, If you’re not getting in trouble with your boss at least twice a year, you’re likely not pushing the envelope hard enough. Two slaps a year might be the cost for 10 successes. If you’re not moving forward, well, you’re not moving forward.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blog.jonudell.net/2007/04/10/too-busy-to-blog-count-your-keystrokes/"&gt;&lt;strong&gt;Conserve your keystrokes&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;br /&gt;When you’re emailing a single person or a reasonably sized cc: list, ask yourself, are you wasting your time? Is this a message that 10 people need to see, or 10,000? Is email where you should be spending your time. Actively be aware of the number of people you communicate with , and the relative level of influence. Is a blog post seen by 50,000 more or less valuable than a single email to your skip-level? Only you can answer, but only if you’re consciously trying to conserve your keystrokes. Your fingers DO have an expiration date; there’s a finite number of keystrokes left, use them wisely.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hanselman.com/blog/DontGiveBileAPermalinkFindingBalanceWithinTheNoAssholeRule.aspx"&gt;&lt;strong&gt;Don’t give bile a permalink&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;.&lt;/strong&gt;&lt;br /&gt;While you’re on the clock, think about what you tweet and FB. It only takes one bad link to undo a year’s work. Same goes for tweeting product launches before they’ve launched.&lt;br /&gt;Write down what you’re trying to accomplish and hang it on the wall.&lt;br /&gt;Make T-Shirts. Tell your spouse and kids. If you’re working towards a goal, tell people. It’ll keep you honest and it’ll motivate you. Saying things out loud help make them reality.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Manage Up&lt;br /&gt;&lt;/strong&gt;Are your commitments aligned with your boss and your bosses boss? Do you have visibility into their commitments? If not, ask for them. Make sure your accomplishments are making yourself, and your boss, look good.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.hanselman.com/blog/ZEBZeroEmailBounceAndANewOutlookRule.aspx"&gt;&lt;strong&gt;Have a System to Manage Information Flow&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;If you’ve got 1000 emails in your Inbox, it’s not an Inbox. It’s a pile of crap. Have a system, any system, to triage your work. Any item in your inbox should be processed: Do it, drop it, defer it, delegate it. There are no other actions to take. Are you effectively managing your information flow? Try scheduling time for email on your calendar.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-429348995608113588?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/429348995608113588/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/best-practices-and-your-personal-brand.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/429348995608113588'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/429348995608113588'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/best-practices-and-your-personal-brand.html' title='Best Practices and your &quot;Personal Brand&quot;'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-2511653006364296344</id><published>2009-07-20T05:58:00.000-07:00</published><updated>2009-07-20T06:00:16.062-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='work'/><category scheme='http://www.blogger.com/atom/ns#' term='carrer'/><category scheme='http://www.blogger.com/atom/ns#' term='job'/><category scheme='http://www.blogger.com/atom/ns#' term='pride'/><title type='text'>Dudley's Bad Advice</title><content type='html'>Just responded to an article on examiner.com.  Wow...what kind of advice/attitudes are out there these days!!  See below...&lt;br /&gt;&lt;br /&gt;Article:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.examiner.com/x-3040-Life-in-the-Cubicle-Examiner~y2009m7d12-Dear-Dudley-Should-I-quit-my-day-job-after-starting-my-own-business"&gt;http://www.examiner.com/x-3040-Life-in-the-Cubicle-Examiner~y2009m7d12-Dear-Dudley-Should-I-quit-my-day-job-after-starting-my-own-business&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My response:&lt;br /&gt;&lt;br /&gt;Dudley -&lt;br /&gt;I cannot believe the AWFUL advice you actually put in print and published for all the world to see.  "Stop caring" and "Try to get laid off"...what is that?!?!? &lt;br /&gt;&lt;br /&gt;Where is your personal pride in a job well done?  The real character of a person is measured not in what someone does when people are watching, but what a person does when no one is around.  You say to "always be incredibly couteous" but you can see this kind of passive aggressive attitude a mile away.  This kind of behavior only burns bridges with not only your current company, but the co-workers that are relying on you to do THEIR jobs...which some of them DO enjoy and have pride in.&lt;br /&gt;&lt;br /&gt;Remember...we are not only accountable for ourselves!  Do a GOOD job and have pride in your work - ALL THE TIME - whether or not it is for someone else or for you.  Your name and your reputation are ALWAYS going to follow it.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-2511653006364296344?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/2511653006364296344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/dudleys-bad-advice.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/2511653006364296344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/2511653006364296344'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/dudleys-bad-advice.html' title='Dudley&apos;s Bad Advice'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-5509363450711698265</id><published>2009-07-01T11:45:00.000-07:00</published><updated>2009-07-01T11:49:28.650-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='lambda'/><category scheme='http://www.blogger.com/atom/ns#' term='.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='query'/><category scheme='http://www.blogger.com/atom/ns#' term='AdventureWorks'/><category scheme='http://www.blogger.com/atom/ns#' term='expression'/><category scheme='http://www.blogger.com/atom/ns#' term='where'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='Linq'/><category scheme='http://www.blogger.com/atom/ns#' term='select'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><title type='text'>LINQ-SQL – Incorrect results from Count() from Lambda expressions</title><content type='html'>Joel Varty recently had a question on his blog:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/joelvarty/archive/2009/03/06/linq-sql-incorrect-results-from-count-from-lambda-expressions.aspx"&gt;http://weblogs.asp.net/joelvarty/archive/2009/03/06/linq-sql-incorrect-results-from-count-from-lambda-expressions.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;My answer to this issue is below...&lt;br /&gt;&lt;br /&gt;I’m surprised Joel didn’t answer his own question of “Can anyone explain this?”…HE is the expert…anyway…I’ll venture my own 2 cents (may be all it’s worth):&lt;br /&gt;&lt;br /&gt;The answer is because the Select operator is used to create an output sequence of one kind of element to another type of element. In other words…you have a list of “stuff” and you want to extract another list using the first list as the base. The lambda expression used does not FILTER; rather, it MASSAGES the output data to look the way you want it.&lt;br /&gt;&lt;br /&gt;Just as illustration:&lt;br /&gt;&lt;br /&gt;You can do the EXACT same thing on the AdventureWorks database. The following uses a quick 5 minute mock up using AdventureWorks and the Entity Framework to access the data:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;//ObjectQuery&lt;employee&gt; employeeQuery&lt;br /&gt;AdventureWorksEntities entities = new AdventureWorksEntities();&lt;br /&gt;&lt;br /&gt;ObjectQuery&lt;employee&gt; employees = entities.Employee;&lt;br /&gt;&lt;br /&gt;int count1 = employees.Count(p =&gt; p.Gender == "M");&lt;br /&gt;int count2 = employees.Select(p =&gt; p.Gender == "M").Count();&lt;br /&gt;int count3 = employees.Count(p =&gt; p.Gender == "F");&lt;br /&gt;int count4 = employees.Where(p =&gt; p.Gender == "M").Count();&lt;br /&gt;&lt;br /&gt;System.Diagnostics.Debug.WriteLine(string.Format("Males (way 1)(Correct - uses Count): {0}", count1));&lt;br /&gt;System.Diagnostics.Debug.WriteLine(string.Format("Males (way 2)(Incorrect - Uses Select): {0}", count2));&lt;br /&gt;System.Diagnostics.Debug.WriteLine(string.Format("Females (way 1)(Correct - uses Count): {0}", count3));&lt;br /&gt;System.Diagnostics.Debug.WriteLine(string.Format("Males (way 3)(Correct - uses Where): {0}", count4));&lt;br /&gt;&lt;br /&gt;Your results will be:&lt;br /&gt;&lt;br /&gt;Males (way 1)(Correct - uses Count): 206&lt;br /&gt;Males (way 2)(Incorrect - Uses Select): 290&lt;br /&gt;Females (way 1)(Correct - uses Count): 84&lt;br /&gt;Males (way 3)(Correct - uses Where): 206&lt;br /&gt;&lt;br /&gt;The WHERE statement does the similar thing the count does, so you will get the same results.&lt;br /&gt;&lt;br /&gt;The proper use of Select would be to get a different view set of employee Data….kind of like the following using anonymous types:&lt;br /&gt;&lt;br /&gt;var employeeStuff = employees.Select(p =&gt; new&lt;br /&gt;{&lt;br /&gt;AmAWoman = p.Gender == "F",&lt;br /&gt;SSN = p.NationalIDNumber,&lt;br /&gt;UID = p.LoginID,&lt;br /&gt;Title = p.Title,&lt;br /&gt;DOB = p.BirthDate,&lt;br /&gt;Motto = p.Gender == "M" ? "I am a Man!!" : "A am Woman - watch me Roar!"&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;foreach (var item in employeeStuff)&lt;br /&gt;{&lt;br /&gt;System.Diagnostics.Debug.WriteLine(string.Format("{0}; {1}; {2}; {3}; {4}; {5}", item.SSN, item.UID, item.Title,&lt;br /&gt;item.DOB, item.Motto, item.AmAWoman));&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;(results – only the first few)&lt;br /&gt;14417807; adventure-works\guy1; Production Technician - WC60; 5/15/1972 12:00:00 AM; I am a Man!!; False&lt;br /&gt;253022876; adventure-works\kevin0; Marketing Assistant; 6/3/1977 12:00:00 AM; I am a Man!!; False&lt;br /&gt;509647174; adventure-works\roberto0; Engineering Manager; 12/13/1964 12:00:00 AM; I am a Man!!; False&lt;br /&gt;112457891; adventure-works\rob0; Senior Tool Designer; 1/23/1965 12:00:00 AM; I am a Man!!; False&lt;br /&gt;480168528; adventure-works\thierry0; Tool Designer; 8/29/1949 12:00:00 AM; I am a Man!!; False&lt;br /&gt;24756624; adventure-works\david0; Marketing Manager; 4/19/1965 12:00:00 AM; I am a Man!!; False&lt;br /&gt;309738752; adventure-works\jolynn0; Production Supervisor - WC60; 2/16/1946 12:00:00 AM; A am Woman - watch me Roar!; True&lt;br /&gt;690627818; adventure-works\ruth0; Production Technician - WC10; 7/6/1946 12:00:00 AM; A am Woman - watch me Roar!; True&lt;br /&gt;695256908; adventure-works\gail0; Design Engineer; 10/29/1942 12:00:00 AM; A am Woman - watch me Roar!; True&lt;br /&gt;912265825; adventure-works\barry0; Production Technician - WC10; 4/27/1946 12:00:00 AM; I am a Man!!; False&lt;br /&gt;998320692; adventure-works\jossef0; Design Engineer; 4/11/1949 12:00:00 AM; I am a Man!!; False&lt;br /&gt;245797967; adventure-works\terri0; Vice President of Engineering; 9/1/1961 12:00:00 AM; A am Woman - watch me Roar!; True&lt;br /&gt;844973625; adventure-works\sidney0; Production Technician - WC10; 10/1/1946 12:00:00 AM; I am a Man!!; False&lt;br /&gt;233069302; adventure-works\taylor0; Production Supervisor - WC50; 5/3/1946 12:00:00 AM; I am a Man!!; False&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-5509363450711698265?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/5509363450711698265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/linq-sql-incorrect-results-from-count.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/5509363450711698265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/5509363450711698265'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/07/linq-sql-incorrect-results-from-count.html' title='LINQ-SQL – Incorrect results from Count() from Lambda expressions'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-1800787148066659641</id><published>2009-06-24T05:36:00.000-07:00</published><updated>2009-06-24T05:40:53.581-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Server'/><category scheme='http://www.blogger.com/atom/ns#' term='inheritance'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='HierarchyId'/><category scheme='http://www.blogger.com/atom/ns#' term='modeling'/><category scheme='http://www.blogger.com/atom/ns#' term='SQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>HierarchyId in SQL Server</title><content type='html'>I just had a collegue send an email out to the team regarding the new HierarchyId in SQL server. I wanted to share with you my response to that. I'll start with His email and then follow up with my response.&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Original Email:&lt;br /&gt;&lt;br /&gt;I’m a bit worried by posts like this:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.sqlskills.com/blogs/simon/post/SQL-Server-2008-HierarchyId-whats-the-point.aspx"&gt;http://www.sqlskills.com/blogs/simon/post/SQL-Server-2008-HierarchyId-whats-the-point.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Does anyone know of a strong argument for using HierarchyId?&lt;/p&gt;My Response:&lt;br /&gt;&lt;br /&gt;Microsoft’s documentation on HierarchyId is found here:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/bb677290.aspx"&gt;http://msdn.microsoft.com/en-us/library/bb677290.aspx&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I think conceptually, someone at Micro$oft decided that they wanted a new (data-centric) way of managing information in a hierarchy tree. It sounds like they wanted a one-stop-shop way of being able to parse and determine children and manage nodes that were aware of the current data structure. Just from the last few minutes of research, I cannot say that I’m sold on it seeing as I come from an “old school” of managing these types of relationships – good old fashion data structures and a good data model that logically describes what you are trying to convey. Adding an additional ID (and management layer) which lays the management responsibility on the database, in my opinion, reduces your flexibility and ability to manage the data as you need. What’s the old saying: some are willing to give up freedom for security/convenience – sounds like other things happening on a national level – ah, but I digress! (Enough on that)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-1800787148066659641?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/1800787148066659641/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/06/hierarchyid-in-sql-server.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/1800787148066659641'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/1800787148066659641'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/06/hierarchyid-in-sql-server.html' title='HierarchyId in SQL Server'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-1068308873236087355</id><published>2009-06-15T06:41:00.000-07:00</published><updated>2009-06-15T06:45:31.854-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='UML'/><category scheme='http://www.blogger.com/atom/ns#' term='software'/><category scheme='http://www.blogger.com/atom/ns#' term='design'/><category scheme='http://www.blogger.com/atom/ns#' term='modeling'/><category scheme='http://www.blogger.com/atom/ns#' term='Complexity'/><title type='text'>Complexity in UML Modeling</title><content type='html'>I just saw a question on linked-in and thought I would answer it with my 2 cents:&lt;br /&gt;&lt;br /&gt;The Question:&lt;br /&gt;Top 10 concepts/ things designer/ modeler finds it difficult to model using UML 1.x/ 2.x standards. This doesn't includes complexity/ easiness of using specific tools. Eg. modeler may find it difficult to model concurrency/ scheduling/ priority/ activites in a loop etc.&lt;br /&gt;  My Answer:&lt;br /&gt;&lt;p&gt;Well, I don't have 10, but I can give you the biggest drawback (as I will call it) regarding UML modeling in general.  Contrary to many-an-architect's efforts, software has always been fluid.  Changing requirements and design have been with us since the dawn of the first computer program.  We have evolved a great deal with the processes that we use to create software - from Waterfall to agile - we have always had to find new and better ways to handle changes.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;UML is a wonderful tool in conveying the intent, design, and operation of the software we are architecting.  The drawback with it is the same as the software we are writing - how to handle changes.  A UML diagram is good only for the moment that it is drawn.  Once the design or code has been refactored, the diagram is useless.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Do we stop using UML??  By no means - I think we need to use it for what it is best at - conveying architecture and design while the software is being built.  OK...what do I mean by that?  Here are some concrete examples:&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Use cases - with the intent of documenting the requirements - we should expect it to be fluid over time.  Can (and should) change - make sure that your tool can baseline your requirements and gives you the ability to document them over time.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Class, object, state diagrams - useful for showing the current relationships of the objects being used - likewise can be used during a code/design session to help convey ideas.  Shouldn't put one of these into a design document because it WILL change upon the refactoring of the system.  Best used as a tool during the design and code phase for collaboration between developers or helping a developer/architect to "visualize" the object relationships.  If the development IDE can generate these - then all the better - don't spend your time trying to manually keep up with these.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Sequence, collaboration, activity - shows the actions going on between the objects over time.  Once again - only accurate for the moment it is printed.  I have used many of these on a white board explaining the operation of a process or system, and have published a few of them too.  Once again - if your IDE can generate one, then great.  Don't spend your time manually keeping up with them - you'll be chasing your tail.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Component and deployment diagrams - don't change as quickly and can convey the overall architecture.  I would say these are easier to keep up with manually because of the nature of the information they are conveying.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Overall - my favorite use of UML diagrams are (as mentioned above):&lt;/p&gt;&lt;ol&gt;&lt;li&gt;On a white board to convey an idea and/or architecture.  Good for getting the ideas across, using them for the design or code and then throwing them away.&lt;/li&gt;&lt;li&gt;If you have an IDE or tool that can auto generate UML diagrams for you, then I've used them to auto-generate models so I could understand new code as I am coming up to speed with an existing application.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;br /&gt;Anyway...that is my 2-3 cents worth.  I'd be interested in hearing what others have to say.&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-1068308873236087355?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/1068308873236087355/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/06/complexity-in-uml-modeling.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/1068308873236087355'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/1068308873236087355'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/06/complexity-in-uml-modeling.html' title='Complexity in UML Modeling'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-4047616586780695381</id><published>2009-05-27T07:25:00.000-07:00</published><updated>2009-05-27T07:29:36.045-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='database inheritance modeling'/><title type='text'>Database Inheritance - my 2 cents</title><content type='html'>&lt;p&gt;I'm currently in a discussion with a co-worker regarding how to implement inheritance in a database.  Yes...I know that databases don't directly support inheritance, but there are some common patterns to how this can be handled.&lt;/p&gt;&lt;p&gt;Martin Fowler talks about the three major database inheritance patterns…&lt;br /&gt;&lt;br /&gt;Single Table:  &lt;a href="http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html"&gt;http://www.martinfowler.com/eaaCatalog/singleTableInheritance.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Class Table:  &lt;a href="http://www.martinfowler.com/eaaCatalog/classTableInheritance.html"&gt;http://www.martinfowler.com/eaaCatalog/classTableInheritance.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Concrete Table:  &lt;a href="http://www.martinfowler.com/eaaCatalog/concreteTableInheritance.html"&gt;http://www.martinfowler.com/eaaCatalog/concreteTableInheritance.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The way we have it implemented now is using the concrete table method.  I have to admit I am more of an advocate of the class level method.  I know the CRUD methods are a bit more complex, but I believe it pays some better dividends in the realm of maintenance as well as the model being more straight forward.  The two main maintenance items I’m talking about are that if any of the common fields change, then you have multiple tables to modify as well as the DAO and DTO objects to update.  The biggest item, however, is enforcing database relationships.  We have other tables that reference back to the main identifier – if they are separated into different tables, then there is no way to enforce that relationship.  It will also make the logic behind those interactions more complex as well - not to mention the queries to support the reports that will need to be generated from the data.&lt;/p&gt;&lt;p&gt;Anyone else have any other comments - I'd love to hear them!&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-4047616586780695381?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/4047616586780695381/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/05/database-inheritance-my-2-cents.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/4047616586780695381'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/4047616586780695381'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/05/database-inheritance-my-2-cents.html' title='Database Inheritance - my 2 cents'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-3170674981286062828</id><published>2009-05-27T05:47:00.000-07:00</published><updated>2009-05-27T05:57:25.365-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows Workflow Foundation Dependency Properties Microsoft .NET C#'/><title type='text'>Dependency Properties - "Pre"-compilation</title><content type='html'>OK, all of you Windows Workflow Foundation Experts out there. I have a question for you. (note this would go to the MSDN forums, but they are currently having login problems to Windows Live - maybe I'll repost it there later).&lt;br /&gt;&lt;br /&gt;I'm not sure where to turn - other than just refactoring the way I'm doing things so I don't have to use the technique/design that I've put together. Which is what I'm going to do after I post this.&lt;br /&gt;&lt;br /&gt;Here is the scoop:&lt;br /&gt;&lt;br /&gt;I'm putting together a rather large state machine workflow using Windows Workflow Foundation. I have a custom activity that I've built that takes in an object and does some "stuff" based on the object that is passed in. Specifically, the activity calls an object that sends some notifications - this code was already written and we are just reusing it. The Custom activity simply is the wrapper to do the notifications. OK...easy enough...&lt;br /&gt;&lt;br /&gt;To call this activity from my workflow - I need a reference to the object that has the information regarding the people to notify. In my example I have a Quote object. This quote object has some information that tells the notification which people need notified. (note that the notification object takes different types and can notify based on those different types...the Quote is simple a concrete version of those other types).&lt;br /&gt;&lt;br /&gt;So, how do I do this - I create a dependency property in by custom activity called EntityForNotification. The type of that dependency Property is of the parent type for Quote - so I can send a Quote or other concretes into it. Then it will take and perform notifications. In my State Machine workflow, I add the custom activity and set the dependency property to a dependency property that I have set up in my state machine. In this case - the Dependency Property is called "Quote".&lt;br /&gt;&lt;br /&gt;Here is the code for the dependency property in the state machine which needs to pass the Quote to the custom activity:&lt;br /&gt;&lt;br /&gt;[DesignerSerializationVisibilityAttribute(DesignerSerializationVisibility.Visible)][BrowsableAttribute(true)]&lt;br /&gt;[CategoryAttribute("Notify Task")]&lt;br /&gt;public QuoteDto Quote&lt;br /&gt;{&lt;br /&gt;get { return (QuoteDto)GetValue(QuoteProperty); }&lt;br /&gt;set { SetValue(QuoteProperty, value); }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Using a DependencyProperty as the backing store for Quote. This enables animation, styling, binding, etc...&lt;br /&gt;public static readonly DependencyProperty QuoteProperty = DependencyProperty.Register("Quote", typeof(QuoteDto), typeof(QuoteStates), new PropertyMetadata(null, DependencyPropertyOptions.Default, new GetValueOverride(getQuoteValueOverride), new SetValueOverride(setQuoteValueOverride)));&lt;br /&gt;&lt;br /&gt;private object getQuoteValueOverride(DependencyObject dependencyObject)&lt;br /&gt;{&lt;br /&gt;QuoteDto result = null;&lt;br /&gt;// Get the quote ID&lt;br /&gt;Guid quoteID = ((QuoteStates)dependencyObject).QuoteID;&lt;br /&gt;// Now return the quote Dto&lt;br /&gt;QuoteDao quoteService = new QuoteDao();&lt;br /&gt;result = quoteService.SelectByPrimaryKey(quoteID);&lt;br /&gt;return result;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;private static void setQuoteValueOverride(DependencyObject dependencyObject, object value)&lt;br /&gt;{&lt;br /&gt;// Not used.&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Notice my usage of the PropertyMetaData and the delegates that override the get and set methods. I don't want to mess with the default getter and setter for the dependency properties, so (as directed by the MSDN forums) I put my custom creation of the QuoteDto into my overridden Quote getter.&lt;br /&gt;&lt;br /&gt;The problem is, that it won't compile. I get a very long winded stack trace (pasted at the bottom of this post) that tells me that my configuration file doesn't contain the connection string for the database connection that is being used by my QuoteDao service - which, by the way, is in a completely different assembly - and works wonderfully in getting my QuoteDto objects. I can comment out the line of code that calls the .SelectByPrimaryKey(quoteID) and it compiles and runs fine. The problem is - with that commented out, there is no quote Dto that gets created and sent back - so that defeats the purpose.&lt;br /&gt;&lt;br /&gt;Why in heaven's name is it trying to validate the Workflow activity based on a call to a completely different assembly and it's need to see a configuration file. Shouldn't they be completely decoupled??? The workflow foundation has injected a dependency that I neither asked for or even want/need - ie. I don't want to create another configuration file to make sure my workflow works. The configuration file is already in my project in another place and enables my data layer to work just fine in all of the other places in my code.&lt;br /&gt;&lt;br /&gt;I think that is about it...if anyone has any suggestions, I'm very willing to hear them.&lt;br /&gt;Thanks!!&lt;br /&gt;&lt;br /&gt;Below is the stack trace for my error:&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------&lt;br /&gt;Error 1 'System.Configuration.ConfigurationErrorsException' while invoking the validator 'System.Workflow.Activities.StateActivityValidator' on activity 'QuoteStates': System.Configuration.ConfigurationErrorsException: The requested database ODS is not defined in configuration. at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.ValidateConnectionStringSettings(String name, ConnectionStringSettings connectionStringSettings) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetConnectionStringSettings(String name) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseCustomFactory.CreateObject(IBuilderContext context, String name, IConfigurationSource configurationSource, ConfigurationReflectionCache reflectionCache) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfiguredObjectStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) at Microsoft.Practices.ObjectBuilder.SingletonStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) at Microsoft.Practices.ObjectBuilder.BuilderStrategy.BuildUp(IBuilderContext context, Type typeToBuild, Object existing, String idToBuild) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.ConfigurationNameMappingStrategy.BuildUp(IBuilderContext context, Type t, Object existing, String id) at Microsoft.Practices.ObjectBuilder.BuilderBase`1.DoBuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp(IReadWriteLocator locator, Type typeToBuild, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.ObjectBuilder.BuilderBase`1.BuildUp[TTypeToBuild](IReadWriteLocator locator, String idToBuild, Object existing, PolicyList[] transientPolicies) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](IReadWriteLocator locator, String id, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp[T](String id, IConfigurationSource configurationSource) at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.NameTypeFactoryBase`1.Create(String name) at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseFactory.CreateDatabase(String name) at GeneraliUsa.Everest.DataAccess.Base.DaoBase.get_Database() in C:\Projects\Everest\Source\App\Libraries\GeneraliUsa.Everest.DataAccess\Base\DaoBase.cs:line 145 at GeneraliUsa.Everest.DataAccess.SalesQuote.QuoteDaoBase.SelectByPrimaryKey(Guid quoteId) in C:\Projects\Everest\Source\App\Libraries\GeneraliUsa.Everest.DataAccess\SalesQuote\QuoteDaoBase.cs:line 170 at GeneraliUsa.Everest.Workflow.Workflows.Quote.QuoteStates.getQuoteValueOverride(DependencyObject dependencyObject) at System.Workflow.ComponentModel.DependencyObject.GetValue(DependencyProperty dependencyProperty) at System.Workflow.ComponentModel.Compiler.DependencyObjectValidator.ValidateDependencyProperty(DependencyObject dependencyObject, DependencyProperty dependencyProperty, ValidationManager manager) at System.Workflow.ComponentModel.Compiler.DependencyObjectValidator.Validate(ValidationManager manager, Object obj) at System.Workflow.ComponentModel.Compiler.ActivityValidator.Validate(ValidationManager manager, Object obj) at System.Workflow.ComponentModel.Compiler.CompositeActivityValidator.Validate(ValidationManager manager, Object obj) at System.Workflow.Activities.StateActivityValidator.Validate(ValidationManager manager, Object obj) at System.Workflow.ComponentModel.Compiler.XomlCompilerHelper.ValidateActivity(Activity activity, WorkflowCompilerParameters parameters, WorkflowCompilerResults results) C:\Projects\Everest\Source\App\Libraries\Generali.Everest.Workflow.BusinessProcesses 1 1&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-3170674981286062828?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/3170674981286062828/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/05/ok-all-of-you-windows-workflow.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/3170674981286062828'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/3170674981286062828'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/05/ok-all-of-you-windows-workflow.html' title='Dependency Properties - &quot;Pre&quot;-compilation'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8101338433170556648.post-4523532701810675635</id><published>2009-04-12T19:32:00.000-07:00</published><updated>2009-04-12T19:34:43.360-07:00</updated><title type='text'>We're Baaaack</title><content type='html'>Well, after a while of moving around (upgrading) server hosts, I think we are finally back up and running.  I'll do my best at getting back some of the old content, some of it was very popular.  However, in the mean time I'll start the regular posts again.  Thanks for hanging in there with me.&lt;br /&gt;&lt;br /&gt;Enjoy!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8101338433170556648-4523532701810675635?l=blog.bigfishsolutions.biz' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://blog.bigfishsolutions.biz/feeds/4523532701810675635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://blog.bigfishsolutions.biz/2009/04/were-baaaack.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/4523532701810675635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8101338433170556648/posts/default/4523532701810675635'/><link rel='alternate' type='text/html' href='http://blog.bigfishsolutions.biz/2009/04/were-baaaack.html' title='We&apos;re Baaaack'/><author><name>Paul (The Minnow)</name><uri>http://www.blogger.com/profile/01155273512159895867</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://3.bp.blogspot.com/_cP9rVtcFZqA/SOLsqcvtOuI/AAAAAAAAAAg/zQ-ty8qGJ8s/S220/IMGP0894.JPG'/></author><thr:total>0</thr:total></entry></feed>
