DCSIMG
Why I don’t like Prism - אלעד כץ | Elad Katz
Sign in | Join | Help

אלעד כץ | Elad Katz

לגו של גדולים

Why I don’t like Prism

פורסם בתאריך Oct 29 2010, 01:15 PM על ידי eladkatz | ישנם 3 תגובות

It’s a well known fact that Prism is the best thing since sliced bread. However, more often than not, I see one project after the other where Prism killed the project. And here’s why;

Prism is a very cool framework. It helps us implement a LOT of very very important Design Patterns; including:

1. View Injection

2. Dependency Injection

3. Inversion of Control (with the help of Unity, or any other IOC Containers.)

4. Event Aggregation.

5. MVC-like UI Architecture (be it MVC, MVP, PresentationModel, or MVVM)

And More.

 

Now don’t get me wrong. All of the above Design Patterns are extremely important, and being an architect without being fluent with them all is impossible. BUT, and that’s a big BUT.

What if I don’t need it all?

Almost everything Prism gives me as a bundle, I can get as parts. If I need DI then I’m going to add DI. If I need MVVM I’m going to use MVVM. Prism gives me too much, and it’s all bundled!!

Of course, one might argue that you don’t have to use everything in Prism, just use some parts of it, and they would be right. Only that’s not what I’m seeing in the industry in projects that implemented Prism. They don’t implement a subset of it, they try and implement it all… emphasis on TRY.

IMHO, if there’s one deadly sin in the software arena, is to use a Design Pattern you don’t understand. This causes that biggest problems of all, and as far as I’m concerned I’d rather see Anti-Patterns then see someone use IOC Containers without fully understanding who exactly is creating the dependencies, and how does this magic work. Magic == Bad.

 

To top all that, the one thing that Prism brings to the table that is Prism’s own doing is View Injection / Region management.

It’s a sophisticated Design Pattern, which I don’t like for two reasons.

a. Who the hell needs it? This is an overkill for 95% of projects. I do agree that for 5% it’s important, but for the rest it adds a layer of sophistication that is purely redundant!

b. It’s sophisticated. And sophisticated == bad. Good architecture is simple architecture, or as my former CEO would say KISS.

 

Dedicated to Alex Golesh & Tomer Shamam Smile

kick it on DotNetKicks.com

רשימת תגובות

# re: Why I don’t like Prism

פורסם בתאריך Friday, October 29, 2010 1:45 PM על ידי Tomer Shamam  

Agree with some of the things you said, but have to say that Prism is not just CAL, it’s great guidelines for how to create a Composite UI applications.

Using Prism or not, UI architects should ask themselves if Composite UI is the right solution for their project, and Prism guidelines helps answering this question.

In case that you’re not writing Composite UI you can still use the Prism’s CAL which includes great Design Patterns as you described in this post:

1. Loosely coupled events (LCE) or pub/sub – i.e. Event Aggregator.

2. Custom commands and composite commands – i.e. Delegate command.

3. IoC and DI container – bring to us by prism as Unity container, and adapters to select other.

4. More…

These patterns are implemented in many MVVM free bundles such as Caliburn, MVVM Toolkit and other.

In the bottom line:

1. Use Prism if you’re going to develop a WPF or Silverlight Composite UI.

2. Use Prism CAL if you’re going to develop WPF or Silverlight applications and you need some of the patterns described above.

Have to mention that Prism vNext includes MVVM support and guidelines, MEF integration and more.

Tomer

# re: Why I don’t like Prism

פורסם בתאריך Friday, October 29, 2010 1:56 PM על ידי eladkatz  

Tomer, I accept your apology ;)

# Why I Don't like Prism

פורסם בתאריך Saturday, October 30, 2010 2:22 AM על ידי DotNetKicks.com  

You've been kicked (a good thing) - Trackback from DotNetKicks.com

שלח תגובה

(שדה חובה) 
(שדה חובה) 
(אופציונלי)
(שדה חובה) 

Enter the numbers above: