Posted by
Marcin Obel – September 23, 2009
Few days ago Pawel Lesnikowski has blogged about his Live Templates for ReSharper. Because I think it is good idea to share such things with other developers I decided to show my Live Templates I have made to be able to create BDD specifications with MSpec faster. Here they are:
specc – Short template for MSpec BDD context
public abstract class with_$Context$
{
Establish context = () =>
{
$END$
};
}
specf – Full template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$
{
Establish context = () =>
{
};
Because of = () =>
{
};
It should_$Behaviour$;$END$
}
specs – Short template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$
{
It should_$Behaviour$;$END$
}
spect – Default template for MSpec BDD specification
[Subject(typeof($Subject$))]
public class when_$Specification$ : with_$Context$
{
Because of = () =>
{
};
It should_$Behaviour$;$END$
}
Here you can download definition of all mentioned templates which can be imported to your ReSharper: MSpec.LiveTemplates
Posted by
Marcin Obel – September 10, 2009
In my previous post I have mentioned that I am currently evaluating the ASP.NET MVC in context of usage for building internal corporate applications. During the evaluation I have made my small SWOT analysis and I want to share it with you in order to get to know what your opinion on this topic is. Because my all thoughts reside in a mind map I have dumped them to the plain list:
Strengths:
- It is based on the Convention over Configuration principle, what means less ceremony in code and more time to focus on business rules;
- It is highly extensible with many points of extension in every part of application lifecycle.
- It is highly testable no matter if you are using the TDD or BDD style of unit testing;
- It is provided by Microsoft – big player on the market, what at least in theory guarantee that the solution will be supported for a long time;
- It contains a lot of elements known from classic ASP.NET like notion of session, modules, handlers, HTTP context, views based on ASPX pages and ASCX controls. This is quite important if employees have to switch to the ASP.NET MVC and previously they have used classic ASP.NET, because the learning curve is smaller;
- It does not use the ASP.NET postback and view state models what improves testability and separation between user interface and business logic;
- It has a routing functionality what enables cleaner URLs;
- It gives the full control over all aspects of developed application. Many elements of the ASP.NET MVC can be easily replaced with its custom implementation (i.e. view engine, controller factory);
- It gives the full control over HTML and how views are rendered;
- It has a great AJAX and JSON support so usage of JavaScript frameworks like jQuery is trivial;
- It can be easily integrated with any of popular Inversion of Control frameworks;
- It has quite big community, there is a lot of online documentation and books;
Weaknesses:
- It is based on the Convention over Configuration principle, what means more magic working in a background (probably harder debugging in some cases);
- It is not event driven, so can be difficult for people who know only ASP.NET Web Forms to wrap their minds around it;
- Third party libraries support is not that strong. Not to many companies write extensions for this framework what means more work for internal team;
- Current version (1.0) requires some additional effort to reduce usage of magic strings to the minimum;
Opportunities:
- Allows for Test Driven Development – it is build with TDD in mind, so it is much easier to write unit tests, mock objects and to intercept the program flow;
Threats:
- Bigger ramp-up and training time is required for developers with no or little experience in web application development;
For the time being this is all what came up to my mind. If you have some other thought I will be grateful if you will share them with me.
Posted by
Marcin Obel – August 25, 2009

Each big organization like this in which I work is mostly based on processes. Everything from purchase orders to computer hardware is described by them. To be honest I am not a big fan of this way of work. My mind is closer to Agile way of thinking rather than stiff procedures for solving problems but from a bigger perspective this approach seems to work because my current employer has over 100 years and is in very good health.
One thing which is quite funny with processes is that someone has to figure out how each of them should work. In case of my department, which is very young and in its nature very different than rest of the organization, there is no process for many things and we have to develop them for our own. One of our processes is “software development process”. Because the department consists of about 300 developers, administrators and IT specialists and we are using wide range of tools and technologies, the process I mentioned above is very general and describes things in a high level. In order to be able to use it and be safe in case of internal or external audit we need many supporting documents which customize it to a needs of particular team. This detailed documents describe how we should do development in a particular technology (for example .NET Framework), what tools, libraries, methodologies can we use etc. Of course we do not choose tools with which we will work only basing on our subjective opinions and feelings. During choosing process each technology or tool is evaluated by a group of specialist (developers, administrators) and compared to its competitors/equivalents which are available on the market.
Currently I have a pleasure to initialize a process of ASP.NET MVC evaluation. Its purpose is to check if this framework can be used as the replacement for ASP.NET Web Forms and Model-View-Presenter pattern which we are using now. Because the evaluation process does not touch only ASP.NET MVC but also other presentation framework for web .NET application me and my teammates had to prepare a list of things to check and evaluate:
- Data binding
- Validation
- Navigation
- State saving
- Embedded controls support
- Testability
- Security
- Collaboration between developers and UI designers
- Adoption to existing projects
- Extensibility
- Community support
- Documentation availability
- Development tools support
Order in which topics on the list appear is accidental and all items are in my meaning equal in theirs importance.
Because I am currently at the beginning of the ASP.NET MVC evaluation I do not have to much more I could share with you. Only thing I have prepared is a mind map with detailed topics I will have to take a look at. I will provide more information about pros and cons of the framework for a big companies in a next posts. If you would like to hear about something regarding this topic please leave your comment below.
Posted by
Marcin Obel – August 23, 2009
Since some time I have had a feeling that I should turn my eyes in direction other than .NET and technologies connected to it. Maybe not as a new path of career, because I have invested a lot of time to get to the point where I am now, but as something additional what can give me some new perspective and help to become a better developer. Because I cannot learn all available technologies I had to choose one and only one of them. After reading some blogs and mostly because of Jeremy D. Miller’s opinion my choice fell on Ruby and the Rails. So many developers are excited about this technology, I decided to find out what is a source of theirs excitement.
So how am I going to learn Ruby? First of all I always try to start from a book. In this case I am going to read (in fact I have already started yesterday) Polish translation of “Ruby in a Nutshell” by Yukihiro Matsumoto. I think and the author has the same opinion that this is not the book for someone who is new to programming and wants to learn his first language. The “Ruby in a Nutshell” is something like language reference but in more accessible form so for me (developer with above 8 years of commercial experience) is perfect. I do not need 20 pages of description how to use while loop or what are iterators and where can be used.
I am not able to read this type of book from end to end without touching computer so during reading I am going to play a little bit with the language itself in a more practical manner. In order to do it I had to setup a development environment and there I faced first problems. Turned out that current version of Ruby (1.9) for Windows does not have official all-in-one installer. There is installer for version 1.8 and some preview installers for 1.9 which do not work perfectly (at least on my Windows 7 machine). Because of this I had to install Ruby manually using binary distribution and again I had problems. Of course binaries were in a form of compressed file so I uncompressed them and moved to C:\Ruby directory. Secondly I have added C:\Ruby\bin\ path to the environment variables. In my opinion this should be all I have to do to start learning but turned out that I was wrong. The official binary distribution does not contain all required libraries and was crashing from time to time. After some googling I have found very useful blog post (unfortunately I have lost its address) which solved my problems pointing where I can find missing libraries and where should I put them.
When I had Ruby environment ready to work, theoretically I was able to start playing with it but … I am .NET developer and I used to use reach IDEs with syntax highlighting, suggestions, debugging, refactoring tools etc. I decided to find such tool but about it, learning progress and my thoughts about Ruby from perspective of my quite long experience with .NET I am going to write in some of future posts.