Bad experience with extension methods

by Marius Gheorghe 12. July 2010 16:29

Had some bad experience with a OSS library in the context of extension methods. 2 rules were broken:

- the logic of a very important type in that library was implemented with extension methods.

- the extension methods were declared in DIFFERENT namespaces (!!!).

 

That, frankly, is just dumb. Extension methods are used for extending types for which you don’t have the code. Even if you break this rule remember to put the extension method in the same namespace of the extended type so that when somebody is importing the namespace of that type it has access to ALL extension methods automatically.

Tags:

dotNET

Tip to start VS2010 faster

by Marius Gheorghe 7. June 2010 15:50

Add “/nosplash” as a command line argument to VS2010. This shaves off a few second from the loading time .

Tags:

programming

Working with Fiddler on localhost

by Marius Gheorghe 11. May 2010 14:04

Change “localhost” to “127.0.0.1.” (notice the dot after 1). This should do the trick.

Tags:

general

Haiku OS show remarkable improvement

by Marius Gheorghe 11. May 2010 06:27

Just tried the latest Haiku release. Great stuff. Even in VirtualBox this stuff is super fast (reminds me when i first tried BeOS 10 years ago). Haiku is a remarkable OSS feat.

 

Get it from here

Tags:

general

Full screen in Silverlight and Flash

by Marius Gheorghe 8. May 2010 15:40

It sucks that you can’t enable full screen when you have 2 monitors. I mean…seriously….i want to write code on 1 monitor  and watch a full screen presentation (code is kind of hard to watch in a small window , you know ? ) on the other monitor.  It makes sense to exit full screen on 1 monitor but it doesn’t make sense on 2.

 

Is that so hard to implement ?

Tags:

general

Debug this

by Marius Gheorghe 6. May 2010 13:42

 

var container = new Dictionary<int, List<Tuple<int, string, int, Dictionary<int, string>>>> ();

I'm sure it's very fun to debug the code which is using this data structure.

Tags:

dotNET

The daily WTF

by Marius Gheorghe 5. May 2010 11:51
I enjoy reading TheDailyWTF everyday because that site represents best the real world. And darn, from a developer perspective, we live in a bad bad world Laughing

Tags:

programming

VPBO – View Presenter Business Object

by Marius Gheorghe 25. April 2010 16:43
View Presenter BusinessObject (aka VPBO) VPBO (for short) is an attempt to describe a pattern for layer structure and interaction inside of a system. It's like MVP but with a few tweaks. Notice that depending of the system, the entry point can be either the View ( in a regular ASP.NET WebForms app the request is routed to the view) or the Presenter ( in Windows Forms, WPF we call the presenter which instantiates the view).

Here's a diagram of interaction :

1. View . Responsibilities :
- describe the UI (obviously).
- basic control validation.

2. Presenter - the most important piece of the diagram. Responsibilities :
- invoke the business object(s) and get the data required by the view. Remember there is no model so you may need to invoke multiple business objects.
- data caching could be implemented here if it's necessary.
- using the view instance set the data in the view's controls.
- do logical data validation.
- pass to data back to BO to persist it.

3. Business Object. Responsibilities :
- logic goes here.


How is this different from MVP/different stuff ?
- first of all notice that there is no Model. Nor there is a interface that the View must implement. This means less code to write/change and worry about.

- from my point of view, with VPBO i'm trying to describe a way for a nice layered system implemented with the least amount of code.

- some stuff are missing compared with MVP: there isn't a way to test UI.

- should the presenter contain any kind of logic ? It can contain "logic" pertaining to his associated view. No business logic. Also this logic should be written without referencing UI controls so it can be unit tested.

- the presenter can be best described as a orchestrator. Get the BO data, display it, validate it, pass it back to BO.

- if the view is complex you are encouraged to create a master presenter along with multiple smaller presenter which handle specific UI functionality.The view knows only abour the master presenter. This represents a better way to mitigate complexity. Because "rich" UI requires a ton of code, moving that code from view to presenter(s) is a better way to mitigate complexity.

- the interaction between view and presenter can, basically, be "described" with 2 methods : Display and Save. Add more methods depending on your UI requirements. Also note that defining a interface is strictly optional.

 

Small sample using WPF here

Tags:

programming

Moved to bitbucket

by Marius Gheorghe 20. April 2010 12:38

I have decided to move my OSS projects to bitbucket.org to ease up on collaboration. I ended up choosing bitbucket because of Mercurial which is a nice DVCS (although TortoiseHg is not yet as nice as TortoiseSVN).

Tags:

programming

How many versions of CLR are out there ?

by Marius Gheorghe 19. April 2010 05:38

Official versions are :

- the desktop/server version that everyone knows.

- CoreCLR - the Silverlight version.

- the version from .NET Compact framework  (which runs on windows mobile phones, Xbox 360 etc)

- the version implemented in the .NET Micro framework.

 

The more the merrier, i guess.

Tags:

dotNET