Reflector – is it the end or a new beginning?

News of yesterday – "Red Gate has recently acquired .NET Reflector. We will continue to maintain a free version for the benefit of the community." – you remember my post about open source? All open source projects have or may have this problem now or in the future – may collide with someone who sees enough profitability in the tool and offers a deal. Btw – Lutz is working for Microsoft. He is a Senior Software Design Engineer in the Expression Blend team. And the company Red Gate is the same that bought SQL Central community site – and from the experiences with that one I think that was a good deal for both the community and the companies involved. So – I'm looking forward how will Reflector 6.0 look like both from features and pricing point of view – meanwhile looking for alternatives as well 😉 (like DILE).

Open source and … your company?

According to a commenter there is always a question – are we allowed to use non-ms labeled technologies whenever it is appropiate?

Answer is tough – myself had the opportunity to use multiple technologies like NHibernate or NVelocity at multiple projects like a very complex system for a Canadian Insurance Company. And what is ‘worse’ – I was developer of those open source projects at the cost of my employer.The whole things depends not on technology, but it’s inside various brains 🙂

It’s all about things like Not Invented Here, Legacy Software, and Big Brand – these are things that cannot be proven by the right technology, just by the right approach. So, sorry, I cannot give the right answer…

Technorati tags:

Open Source Series 2.: NVelocity (part 2)

I forgot an important part of the previous posts – I was talking about many projects using the original Velocity for many purposes – but is the .NET version used? I tried to put together a noncomprehensive list of usages – feel free to comment to add your own! One important thing – currently there are 2 branches on NVelocity – one can be found at http://nvelocity.sf.net, the other is part of Castle – use the latter one, it has more bells and support as well 🙂

This post is part of the open source series

Open Source Series 2.: NVelocity

Formerly as part of the Apache Jakarta project, now part of the Apache project itself can be found the Velocity project. Since the beginning, it is the de facto tool for generating template driven applications – websites, documents, etc., the list of projects, websites and tools powered by or capable of using Velocity is endless. As for other great and successfull projects (like Hibernate, which also uses velocity for generating POJO files), this was met with the new wind of .NET – there were NVelocity born. So to make it short – NVelocity is a .Net-based template engine – it permits anyone to use the simple yet powerful template language called VTL to reference objects, execute methods, etc defined in .Net code. Speaking of a web application, this leads to the MVC pattern – this simple to use and set up tool enables you to program against modells in your views, and put the controller in charge of binding the two – this (and NHibernate, and ActiveRecord, and Windsor…) is what lead to the born of the Castle and the Rhino projects – but these are in later post :).

So no whistles nor bells, but the main part of NVelocity is:

  • You create the engine – new NVelocity.App.VelocityEngine(ep);
  • You get a template – engine.GetTemplate(“template.vm”);
  • You create a context – new NVelocity.VelocityContext();
  • You fill the context – context.Put(“key”, “value”);
  • Than you merge the context with the template using the engine – template.Merge(context, outputStream);

The extras are coming mostly in the template file, and by the fact, that there are plenty of way to provide plugins into the system – ResourceLoaders for determining where to get the file (from the filesystem? database? embedded resource?), caches of various parts, etc. So, back to template file – what can I do?

  • I can print the value for a key – ${key}
  • I can use property getters and setters – #set ${object}.prop = “value”
  • I can use loops, if-then-else, define macros, etc
  • Call and return any method with parameterlists which may contain values, arrays, dictionaries, etc – ${object}.Method(${key}, “%{key = ‘value’, key2 = ${key}}”);
  • Meanwhile the whole thing is typesafe and – the template gets compiled into an AST tree the first time it met!

So – I think this is a very handy tool for generating source files, for generating documents and for driving data driven websites.

PS: No, it has nothing to do with Microsoft Velocity – that goes into the cache providers series 🙂

This post is part of the open source series

A short overview of cache providers, part 1

In the following few paragraphs I'll try to a give a less-or-more comprehensive view over the world of cache providers. What we call a cache provider? The first thing people generally do is cache things within their web processes. But this means your cache is duplicated multiple times, once for each thread. This is a waste of memory and you'll get low cache hit rates. If you're using a multi-threaded language or a shared memory API like the built-in System.Web.Cache with in-memory settings, you can have a global cache for all threads, but it's per-machine. It doesn't scale to multiple machines. Once you have 20 webservers, those 20 independent caches start to look just as silly as when you had 20 threads with their own caches on a single box. Cache providers' servers and clients work together to implement one global cache across as many machines as you have – like the state server or sql server options for System.Web.Cache. But is the default implementation of System.Web.Cache flawless and perfect? Some says no – there may be improvement both the server and client sides.

Memcached

Why bother with a linux damon cache implementation made by danga? Answer is easy: first of all – there is a win32 implementation for it. Secondly – there are thons of different APIs to access it from .NET. Three of those APIs am I going to further investigate – the .NET memcached client library, the enyim.com Memcached Client, and BeIT Memcached. (interesting thing to mark – 3 projects, 3 different forge – sourceforge, codeplex and google code 🙂 )

The .NET memcached client library is the one, that mostly follows the schema and technology of the java client – it's a 1:1 port of that one.

The BeIT client comes with many bells and whistles, like socket pooling, uses the ketama algorithm for sticking keys to servers (key – server assigment stays the same even if there are new servers added or removed between), most of the simple value types have their own optimized serialization, have compression schemas, automatic key prefixing, dead server detection, etc.

The enyim.com Memcached client comes with nearly the same set of features, except for an additional one – a provider project to wire it up into System.Web.Cache without any additional steps.

As a special experiment, there are .NET implementations of the memcached server as well, and compared to the native C implementation, they even doesn't work that bad. One of the implementations I tried was part of the experimental hive of the Rhino framework – I'll try to cover that framework in a later post 🙂

Open Source Series 1.: Introduce to the series

In this series (probably) lesser known but very valuable opens source projects will be searched for, found, and most important – write about 🙂

In the following parts I try to cover some of my favourites first, but beside having open eyes I have ears as well – if you know some OS project gems, that are useful, don’t hesitate to comment/contact.

Technorati tags: