Pages: 1 2 3 4 5 6 Next

Aggregation vs Composition are driving me nuts!

Posted by Henk van Dijken on November 01, 2011
Modeling / No Comments

image

Both aggregation and composition are special kinds of associations. They are used to represent ownership or a whole/part relationship.

But when should you use them? I am always confused and I have difficulties to remember which one to use when.

It is pretty simple though, composition is just a stronger relationship than aggregation.

An example will probably help. Henk and his brain have a composite relationship. If you destroy Henk, his brain will be non functional too. In fact, it is already pretty non functional since I have a hard time remember this composite relationship thing, but that is besides the point I am trying to make here.

On the other side, Henk and his blog have an aggregate relationship. If you destroy Henk, then his blog will survive. You could also call this a kind of stand-alone composite relationship.

Only we need now is a kind of mnemonic reminder!

Unfortunately, I cannot think of one…

Tags:

The Art and Zen of Model-View-Something

Posted by Henk van Dijken on October 16, 2011
Uncategorized / 1 Comment

Every time I hear people say something like this

maybe we should modernize our architecture and use a MVC design pattern, that is cool!

I would like you to remind that: MVC was first described in 1979… So, it is even more ancient than MFC, which was initially released in 1992!

mvvmFor WPF, we nowadays have MVVM as a more “sophisticated” version of this ancient pattern. In its essence, you have decoupled model(s) and views. The glue between them is the ViewModel, often mentioned as a converter on steroids.

Sounds as good architectural thinking, but remember to put on your pink WPF glasses: it all fits in the presentation layer – except the model.

But what is a model, anyway? It is the same as a data model?

Not necessarily. It resembles more a simplistic view on separation of presentation from the rest of the application logic.

What is great about this pattern is its simplicity after you mastered its steep learning curve. It is worth doing it.

Tags: , , ,

UML Modelling – A Last Tribute to StarUML

Posted by Henk van Dijken on October 05, 2011
Modeling / No Comments

imageFor really a long time, StarUML was the predominant tool for all my UML modelling needs.  Although it is based on UML v1.4, its modelling features are just brilliant.

It has, however, one insuperable impediment: it is a dead open source project way beyond all resurrection boundaries.

In deep secrecy I tried different other UML tools, including Enterprise Architect (EA), MagicDraw and (even) ArgoUML. For a very long time the best candidate was Poseidon for UML, but I found it to Javaish and Eclipsy. That is not my cup of tea.

For some time I work with EA now. It has rich UML functionality, but I am not pleased with its lack of user-friendliness. It possibly works better for laaaarge modelling teams, where you need heavy versioning. I just like to create simple drawings.

And now there is: Software Ideas Modeler

I have some good news, and some bad….

Good news is: so far, so good. Looks like a promising UML modelling tool.

The bad news is: StarUML probably is exit now. Going to miss you.

Tags: , , ,

Lean View on Zen Architect – Top 5 Posts

Posted by Henk van Dijken on September 30, 2011
Top Lists / No Comments

I am just back from attending a Leader’s Workshop Lean Software Development by the Poppendiecks.

One of many valuable things I learned is that you have to eliminate waste that does not add customer value.

 

C# Design Patterns Top Posts

  1. Chain of Responsibility
  2. Factory Method
  3. Abstract Factory
  4. Interpreter
  5. State

Other Category Top Posts

  1. Data Access Object design pattern in .NET
  2. Validation Framework – Enterprise Library Validation Block
  3. HTML4 will kill Silverlight, WPF and – in the end – even MFC
  4. O/R mapping – from Database Record to Entity Class
  5. Validation with Unity

What if I applied some lean principles to my blog?

Tags: , , , ,

Answer to the Ultimate Question of Life, the Universe, and Everything

Posted by Henk van Dijken on June 17, 2011
Refactoring / No Comments

Yes, my nerdy friends. I am talking about refactoring.

Refactoring is “a disciplined way to restructure code”, undertaken in order to improve some of the non-functional attributes of the software.

The problem with refactoring is that it is a nerdy thing. No non-technical person on earth will ever ask you: please, will you improve some non-functional attributes for me? Please?

 

It just will not happen!

 

You have to cloak it somehow in an urgent issue or some hot requirement. This, your customer will understand.

 

Your customer wants a modern GUI? In fact, she asks for refactoring.

Your customer complains about slowness of the software? Suggest refactoring!

 

However, never pro-actively suggest refactoring. People could think that you entered play time.

Tags:

HTML5 will kill Silverlight, WPF and – in the end – even MFC

Posted by Henk van Dijken on February 25, 2011
New Technology / 1 Comment

As you probably will know: HTLM5 is already faantastic and will be even more  fantaaastic in the future. And if you didn’t know this, you know it right now because I tell it you right here and right now.

 

Microsoft is also committed to HTML5. Of course, they want to sell and push IE9.

 

HTML5Nevertheless, HTML5 probably will be the next hype killer technology. So, in the unlikely event that you can understand Dutch you should listen and see for your self in this podcast.

 

In fact, there are people that believe that HTML5 is so promising that it probably will blow Silverlight away soon. Thus, that means that Silverlight will be doomed. There are also people in this non virtual world who believe that Silverlight is WPF vNext, thus WPF will also be dead (soon). On first glance, you could think this is some kind of domino effect. A cascading delete, so to speak.

 

Lastly, there are also people that are afraid to abandon MFC because of this doom say. Why should we invest in new technology that is doomed to be dead in the (near) future. Sounds feasible, right?

 

MFC is about 20 years old. Can you believe that there are people who are afraid of abandon MFC? Can you believe that there are people that do not want to invest in new technology as young as WPF?

 

Yes, we can!

Maybe this sounds a little weird to the innovators and early adaptors amongst us, but not to the late majority and laggards (according to the innovation theory of Rogers). Laggards only will embrace new technology when they are forced to. That pops up a new question: how-to get inertia and laggards in motion.

 

Maybe we should investigate that in the near future!

Lesson 1 on Usability – Please don’t make the user think!

Posted by Henk van Dijken on February 18, 2011
Usability / No Comments

usabilityUsability is not that difficult to implement. Not difficult at all. Now I am thinking about it, I find it very impressive how some developers sometimes can create something that is so not usable.

 

It is so easy! The only thing you have to do is make sure that you don’t make the user have to think about it how to accomplish a certain task with your software. This maybe sound easy, but is very hard.

 

One problem is: when you are designing your software the answer is already in your mind. That makes you a biased thinker. You think that it is obvious to find your way in the software.

 

However, when you start with the right answer in mind, your have the wrong starting point for usability.

 

“Move the mouse to the left upper part of the screen.” If you give this instruction to a novice, you would not expect that the user lift up the mouse, moves it towards the monitor and touches the screen. However, some people with absolutely no experience with computers do that.

 

Another problem is: while developing functionality, we already have a certain not so novice user in mind.

 

We think ourselves that we have in mind a picture of a novice user, but in fact that is not completely true. We already know how to do the task, we find it easy to perform. Of course, we implemented it.

 

Therefore we cannot imagine someone who doesn’t. And to be honest, most of the times we just think that the user is plain stupid. However, your user is not stupid. Not at all. The user only is not used to your software, this footprint of your brain. People think differently. Users are not all nerds.

 

So, please think out-of-the-skull-cap and take your usability serious!

Tags:

How to revitalize your legacy MFC

Posted by Henk van Dijken on February 11, 2011
Software Architecture / No Comments

I can see dead people (The Sixt Sense, 1999). They are using MFC (1992-…)

dead-endThis was my first thought when I saw the legacy. I cried in silence for a while, but as soon as I found out that crying didn’t help I decided to handle it like a man. A real man. I had to do something that Steve Ballmer himself would be proud of.

 

So, lets drink one and brainstorm!

 

Of course, there are several options to kill the ugly bastard:

  1. Use the MFC feature pack (2008)
  2. Inject new WPF in your legacy
  3. Rewrite the application to WPF4 (2010)
  4. Host your legacy on WPF

In my opinion, MFC is not the way to go. It has no future. The feature pack enhances it looks substantially, but it is as if you are walking further into the dead end street. Sooner or later you reach its final dead end and have to rewrite all the newly added legacy.

 

You could inject WPF into your legacy backbone. This is possible and some people do that. But not me. To all you people who are considering this I would like to say: though shall not do that! It is like pimping your legacy, despite the pimping it still remains legacy. A piece of junk in a nice wrapping.

 

Then you could rewrite your legacy application to WPF. How desirable and number one wet dream for many programmers, but not always possible. Especially when your legacy is huge. Still some believe that you should retreat for a while (say a couple of years) and rewrite your application. How tempting, but I cannot find a sponsor.

 

Fortunately, there is another option. You can host your legacy on WPF. Let’s investigate that!

Tags: , , ,

What is Unity Dependency Injection Container?

Posted by Henk van Dijken on January 30, 2011
Patterns and Practices / No Comments

I was just reading the “hot” news that Unity 2.0 for Desktop and Silverlight was released. Now you mention it, the release was about a year ago. I agree, but it was its project description that got my attention.

The Unity Application Block (Unity) is a lightweight extensible dependency injection container with support for constructor, property, and method call injection.

 

So, what is Unity and why do we need it?

Unity is a container that is equipped with all plumbing necessary for creating loosely coupled component-based applications. It is a container because you can – so to speak – stuff all kind of components in it, as long as they conform to a predefined interface. It even becomes more handy when you stuff it with cross-cutting concerns, like aspect oriented validation.

Unity uses dependency injection as its prime technique for building loosely coupled applications and, thus, provides several ways to handle the dependencies between objects.

Dependency injection containers are, however, far from new. It was in 2004 that Martin Fowler published Inversion of Control Containers and the Dependency Injection pattern.

Thus, I guess it should be mainstream technology by now. It should be… is it?

Tags:

The Pain Of Model-Driven Template-Based Code Generation Is In The Model

Posted by Henk van Dijken on September 03, 2010
Code Generation, Modeling / 2 Comments

Template-based code generation in fact is pretty easy. It very much resembles ordinary mail merge. You create some (sophisticated) template, fill in all the black holes with metadata from the model, and voila!

All code is generated automagically. A happy ending.

image

But no, often that is not the case. The pain is always in the model. Unfortunately, it is not rich enough in its metadata.

I love UML for communicating, but (natively) it is not rich enough for code generation. Did you ever tried to model a string that must have a length between 5 and 10? Not easy!

That’s why I mostly use a data model – or some slick derivative – as the data providing model.

The Entity Framework is a fine derivative. In fact, it is nothing more than a proprietary class diagram linked to the underlying data model. Microsoft, well done!

Tags:

Pages: 1 2 3 4 5 6 Next