Friday, June 05, 2009

Contemplating MVC for our software

I’m currently in the process of redesigning our software for a new implementation in C#/.Net. Our current implementation is great of course (…) but some considerations made us decide to move away from Delphi into C#/.Net. I’ve listed the reasons before, but to summarize here is a part of the introduction of our formal business case for going C#/.Net.

Microsoft will always invest more than Embarcadero will

As much as I like the Delphi world, there will be more development into C#/.Net than there ever will be into Delphi/Win32. It’s just a matter of size: MS is way bigger than Embarcadero and the number of developers for C#/.Net will always exceed the Delphi/Win2 group.

There are more C# developers than Delphi Developers

It’s a fact. I had a hard time to find experience local Delphi developers. There are plenty C# developers. To just mention a fact: the Delphi user group that I attended had between 5 and 8 developers on each meeting (every 3 months) and I was presenting on every meeting I attended. The dotned group I recently joined has meetings every month with between 20 and 50 developers every time. And the dotnet group is just one of many C#/.Net groups out there.

And there are numerous other considerations to make the move that I won’t mention here. All of them are commercial and strategic considerations, not technical ones.

So, there we go, we will redesign and implement our software.

Design decisions

There are a couple of little draw back to redesigning and reimplementing software (it will set you back a hell of an amount of money) but there are a couple of good aspects too. You can reconsider some design decisions you made earlier. You can apply new technology if you want to. Stuff like that.

There are two major decisions I am currently thinking over:

  1. Will I use DevExpress XPO or will I use the Microsoft Entity Framework for my ORM?
  2. Will I implement a ‘simple’ 3-tier model or will I go for a MVC model?

Deciding Object Relational Model

There is a bit of information available regarding the decision between XPO and the Entity Framework. I found Gary’s Blog (by DevExpress) highly informative. It’s been noted here that I am a huge DevExpress fan and am really considering building our software using XPO. But, the fact that Microsoft is behind the Entity Framework does play a role in my considerations. I haven’t gone into great detail investigating either technology (and I think I must to make a sound decision). It will be between those two I guess.

3-tier model or MVC model?

Our current app is more of a 2-tier model. The business logic is implemented next to the user interface and I want to move away from that. I am currently contemplating a MVC model or a ‘traditional’ 3-tier model. Our software will have a WinForms user interface as its main interface and most of the stuff out there is using ASP.Net (which I will use for only part of the editing work in our software).

I found this blog (http://rdn-consulting.com/blog/2008/02/01/selecting-a-mvcmvp-implementation-for-a-winforms-project/comment-page-1/#comment-1663) that kind of sums up my considerations.

I haven’t made any decisions on these issues, so any thoughts that you think are worth sharing are much appreciated.

Bye,

Bart

20 comments:

Stanko Milosev said...

Just one comment, you never know will Microsoft stop supporting C#. They don't care about us, programmers.

Anonymous said...

How wide is your programming experience? (not talking about tools and languages, but categories of solutions) Choosing technologies by latest TLA, going for IBM as the safest bet... I've heard it all before.

Despite the greater numbers of C# programmers, the quality of assistance and the quality of the solutions I can create with Delphi has so far been superior.

Anyway, an observation based on experience: MVC is essentially an illusion. In practice, you end up implementing every element 3 times in 3 different places. It doesn't work in non-trivial real-world situations.

Roland Beenhakker said...

We pretty much had the same path for a project recently. We decided to go for a Test Driven Development method. Pretty much Domain Driven Design with TDD, trying to use 'known' design patterns. For O/R mapping we decorate our domain objects with attributes, which our own dal can use to generate the appropiate sql queries. We tend to use known design patterns as much as possible.
I think the TDD part can improve the software quality a lot.

Bart Roozendaal said...

@Roland Yep, I agree. TDD is a done deal; we will definitely use that.

Unknown said...

Bart, wich tool Microsoft uses to develop MS Office?

(Sorry about my "engrish")

Bart Roozendaal said...

@João: I don't get your question. I guess they used Visual Studio, C, C++ and C#, maybe some ASM. But, what's the point in asking this? No offense, but I'm not following you. Or am I being too serious now?

Unknown said...

This could be a valious tip, about what you should use on your software.

Or you don't think this way?

Bart Roozendaal said...

@João Henrique: the decisions I need to make are not about the tool or language (that will be Visual Studio and C#/.Net), but are more architectual of nature. What technique should I use for the repository and what system architecture. Stuff like that.

Unknown said...

Ok Bart.

So, thanks for sharing and good luck on your task!

Philippe Wate said...

To trust Microsoft is very naive
remember Visual Basic??
.NET is a bloated dog (like anything MS makes)
I think what matters is how productive one is in the end....
of course you need to find programmers but they can learn Delphi too nobody is born with the knowledge of C#
Sorry you jumped ship...
PW

Ossian said...

.net and c#: they haven't even got proper names. job creation schemes for endless, never delivered bureaucratic money wasting projects. the next bubble to burst following dotcom and banking is microsoft. they can't extort money from the entire world much longer for slow, flakey, cumbersome, ugly, tonedeaf copy attempts of others' more elegant products. they can't get away with their monopoly forever. come george soros, pluck them now - they are ripe. their products are overripe and their programmer tools are rotten. no wonder gates resigned. small companies will still be there when they go the way of gm and good riddance to them, may they be accursed for the misery they have caused me, and the money they have extorted. i put a gypsy curse on them. i hope that all developers stuck with their feet in this setting concrete fall into unconsciousness and never have to realise their horrible and miserable fate. thank you for airing this topic and please reconsider your decision.

David said...

Hi Bart,

I am honestly surprised that someone of your obvious business acumen lists the lack of Delphi developers as a serious problem.

We have just hired a new C# developer and it took him about 2 months to become very proficient in Delphi (i.e. not just basic but quite proficient) and has already contributed a ton even though is a "delphi novice". Our "training" involved him reading Marco Cantu's book on the Pascal language and giving him small projects introducing him to important elements of the VCL.

I would argue that you will waste a lot less time training new Delphi developers than you will rewriting a perfectly functional software.

Radek Červinka said...

I agree with David. Moving programmer from C# to Delphi (or C#->Delphi) is quick task, much more than rewrite all program.

C# has some advantages, but I hate speed of resulting program and fact that C# make from programmers pigs (no carry about resulting code, memory usage, speed...)

Anonymous said...

At my company, we had the same problem, we didn't find any Delphi developers around.

I hired 3 Java developers, and after 1 month of training they join us in large application for an university.

The time we invest on them it much less than if we hire c# team and work on the project with C#, or Develop the application On Java.

That's for new project, and in your case you lose time & money just because you need to make it look new cuz of C#.

develdevil said...

Hi Bart,

I'd say:
please do not mix up incompatible things.

- I (investment) vs. ROI (return on investment)
- quantity vs. quality
- executable vs interpretable
- ...

There exist good reasons to dev using DotNet or Mono ... well as much as (different) good reasons to dev using Delphi or FreePascal.

AFAICS, you aren't "leaving the bad delphi world". you just realign your tools with your specific needs - no problem with that.

You do not have to argument with such a "the good, the bad and the ugly" scenario:
Sergio Leone done that before and you'll hardly top him ;)

T.A. van der Plaats said...

Bart,

May I say a very wise decision to go to C#/.NET! The company I work very has made the decision a number of years ago to do new stuff in C# .Net (after going the unfortunate Delphi.Net route first) and I have never regretted it. (And I wasn't at all happy with the decision at first being a real Delphi fan at that time).
I also learned a lot in the past years and become a better developer by having now the knowledge of more ways to how you normally solve a problem (C# and Delphi), it definitely broadened my horizon.

And not only there are a lot more .Net developers, there is also a lot more functionality included in the standard .Net libraries and much more mature (having only to say one thing: generics. Where are the generics in the RTL/VCL?)

Further I have 2 suggestions for you.
1. Take a very good look at WPF before going Winforms. This in relation to all the new Silverlight development going on (based on WPF) and that WPF/Silverlight is very strong in databinding, which works very well with the MVVP pattern (variation of MVC/MVP)!
2. For ORM: Also take a look at DevForce from Ideablade. We are not using it (yet) but it works nice and is build on top of entity framework. We still haven't decided if we will go that route and in the meantime use the entity framework, which also works pretty well currently and also has very promissing new stuff (like POCO) in .NET 4.0

B.T.W. I still like Delphi, but I think Borland/CodeGear at that time really missed the boat.

Hope this helps a bit... ;-)

T.A. van der Plaats said...

Make that the MVVM {Model view View-Model}patern (not MVVP as I accidently typed above).

Princess said...

A quick grep of the job openings in my area shows 99% are for .net, c# and other Microsoft tools.

So... if anybody wants a delphi coder, I'm available.

victor dot jackal at gmail dot com

Daniel said...

I wonder if Delphi2010 would change your mind. Sounds promising!

Unknown said...

Delphi 2010 is excellent. It even has .... wait for it... generics. I'll stick with Delphi for now. You might be surprised what the future holds. I get the feeling that people are starting to realize that dotnet is not always the right platform, and there is a feeling that Delphi might be on a rebound. We'll see......