Key design principles in Software Development

Software Architecture
Software Development is so many things; to have a good start creativity, passion and methodology have to be a perfect match. While the creativity and the passion are subjective and personal, the methodology is something that can be learnt, developed, enhanced and shared. Like mathematics, it can be seen as an universal language. Principles When developing software there are some best-practices and principles that should be followed so that every software developer should be able to read and understand the application quite quickly. In general, the principles, when applied, should be able to (and not only) minimize maintenance requirements minimizes costs promote usability and extensibility promote testability and correctness of the application Some of the key principles are as follows: Separation of concerns Expressed in a simple sentence: "Divide your…
Read More

Microsoft.NET O/R mapper: choose your own!

Programming, Software Architecture
Only few years ago I was not such a big fan of Object-Relational mapping tools (ORM), but now I have to admit that when starting a new project I'm always thinking whether it makes sense to use it or not. Compared to "traditional" coding techniques, Object-Relational mapping often reduces the amount of code that needs to be written, but I would add as well that a new kind of problems arise too, especially in some more complex scenarios. So particular attention should be taken on the cost/benefit side, like for anything else. Whatever approach is taken, please create different application layers, and especially for the data access, use the Repository pattern. Repository Pattern offers a great way of decoupling the data access from the application logic. So, the golden rule…
Read More

Logic in the database, to be or not to be?

Database, Programming, Software Architecture
Recently I have participated to a couple of discussions about whether the triggers or stored procedures should be used or not in a "real" project, so I decided to write this post to express my point of view. This said, I warn you, there is no a "right" answer, but most probably a "pro" and "cons" about anything written in this post. An old problem There are more than a handful of developers who are not really clear (from the architectural point of view) when to use triggers, views, stored procedures,etc... let's just call this "database logic". Being so easy to change, and so close to the data, one is really tempted to go to the "source" and start coding.  As an alternative read, please check my previous article Direct…
Read More

Agile software development tools and techniques – introduction

Agile, Programming, Project Management, Software Architecture
I've started adopting what I could call "agile" way of developing software only in 2007-2008. Since then I've become a Certified Scrum Master and trying to adopt as much techniques and methodologies to make the process of developing software in my team as much as possible. I am sure that I am still far from saying that it is perfect and there is always room for improvement :). Agile for me is definitively the way to go, but be aware, it is not a silver bullet. There is really a lot to say about agile, and internet is full of articles related to its various topics. I wanted to honor it with this short article putting what I believe are the most important parts of agile that I came across…
Read More

AOP – Method interception in PostSharp with OnMethodBoundaryAspect

Agile, Programming, Software Architecture
For general information about the Aspect Oriented Programming please refer to the earlier post: Aspect Oriented Programming (AOP) basics In general, PostSharp offers a great deal of different types of predefined aspects that can be used and applied on methods, properties, events, fields, etc. The list below is directly taken from the PostSharp documentation. TypeLevelAspect: Which is a base class for all aspects applied on types OnExceptionAspect: Aspect that, when applied to a method, defines an exception handler around the whole method and calls a custom method in this exception handler. MethodLevelAspect: Base class for all aspects applied on methods. MethodInterceptionAspect: Aspect that, when applied on a method, intercepts invocations of this method. MethodImplementationAspect: Aspect that, when applied on an abstract or extern method, creates an implementation for this method.…
Read More

Aspect Oriented Programming (AOP) basics

Agile, Software Architecture
What is Aspect Oriented Programming? In very simple terms AOP is a software programming technique that helps managing cross cutting concerns in software applications. Before describing what “Cross cutting concern” is, we should mention the Separation of Concerns (SoC) paradigm first: When separating concerns, every class or method should be as modular as possible and should be responsible for only "one" thing at a time. In other words, if you have a class that is calculating the yearly mortgage, the same class shouldn’t be responsible of holding the logging logic as this is not the main concern of the class. The main purpose of the class in question would be to perform the calculation(s) connected to the mortgage and not to know how to log or write to the disk.…
Read More

What technology for building Web Services in Microsoft.NET?

Programming, Software Architecture
Just wondering how many different ways are there for creating Web Services (of any kind) in the Microsoft.NET stack. ASP.NET Web Services Introduced from the beginning of the Microsoft.NET. ASP.NET Web Services technology has given a very easy way of creating Services within the Microsoft.NET stack. Even being so easy to implement, ASP.NET Web Services are good only in simple scenarios. ASP.NET Web Services are mainly built around SOAP, but there is a support as well for JSON and XML messages. It's a great start if you want to expose some functionality in an easy way but without pretending too much when it comes to the interoperability. Web Services Enhancements (WSE) WSE is an add-on to the Microsoft .NET Framework which includes a set of classes that implement additional WS-*…
Read More

Direct SQL Access vs. Web Service

Programming, Software Architecture
In this post I would like to analyze the two ways of how applications can exchange data (especially when it comes to the database access). I am mainly a big advocate of SOA (Service Oriented Architecture), but on the other side, you have developers who are more oriented toward direct database connections and sharing the data in this way. I would like to share with you some findings that hopefully will help you if you find yourself in a situation where you need to decide either to go with one or other way. Let's illustrate two of many possible scenarios: As it is shown in the image above, there is the possibility to connect directly to the database, or simply connect to the Web Service instead. Web Services Before continuing…
Read More

An introduction to NoSQL

Database, Software Architecture
In my working career I had to deal with databases since my first day at work and it is a bit a hate-and-love relationship. Usually well working application is always backed up by a good designed database schema and good accessing mechanism. So far I always used RDBMS - Relationship databases such as Microsoft SQL Server, Oracle, MySql, Sybase. Right now there is a big hype about NoSQL movement, which is growing and in my opinion it is going to be a major player in the next years, and it would be good to familiarize with the technology as soon as possible. To note is the fact that some big companies are already investing into or using NoSQL solution. Just to name few: Microsoft is integrating MongoDB into the Windows…
Read More

Top 10 books every microsoft software developer should have

Agile, Books, Programming, Software Architecture
The following is a list of books that I would recommend to every experienced (or not) software developer. Very often I take inspiration by reading again and again some chapters as very often the knowledge (theory), if not practiced, tends to blurry overtime. Please take the list as it is without any order of precedence. Every book is important for its own topic. Patterns of Enterprise Application Architecture – Addison Wesley - Martin Fowler Domain-Driven Design: Tackling Complexity in the Heart of Software - (Evans) LINQ In Action – (Marguerie, Eichert, Wooley) Refactoring To Patterns – Addison Wesley - Joshua Kerievsky The Pragmatic Programmer: From Journeyman to Master - by Andrew Hunt and David Thomas Continuous Integration – Addison Wesley - Paul M. Duvall Microsoft.NET Architecting Applications for the Enterprise…
Read More

Cohesion vs Coupling – Separate Concerns

Programming, Software Architecture
We mention Cohesion and Coupling when we are talking about Software Design Principles. Those two principles were first introduced in the book Structured Design: Fundamentals of a discipline of computer program and system design many years ago, even though the principles were around Structured Programming, they are still valid in the Object Oriented world. Cohesion Cohesion represents the degree of the systematic or logical connection or consistency in the logic expressed in the our code. In other words, it's the level of balance and harmony of the software logic within a module. In a practical example we may say that the modules are cohesive "when a change to A allows B to change so that both add new value". We want our code to be highly cohesive, as the highly…
Read More