Design Patterns & Architecture

Code on Different Types of Codebases

Posted in Design Patterns & Architecture on January 28th, 2013 by Vineet SinhaBe the first to comment

A lot has been written about blogging and working on open source projects to improve your coding skills. They are great ideas. In addition, I like attending user groups.

But there is more. Becoming a great software developer also means making sure you are able to think as the situation demands, as opposed to being biased in the manner that your current project is developed. It means making sure you are comfortable building very different types of projects. read more »

 

Diagramming Tools – A (Biased) Survey

Posted in Agile & Development Methodologies, Design Patterns & Architecture, Developer Tools, Java, UML & Diagramming on September 21st, 2012 by Christopher Deschenes6 Comments

Diagramming tools can help you to quickly understand a new project, debug code, visualize and enforce usage patterns, and quickly generate high quality documentation.  All good.  However, not all tools are created equal and there are lots of legacy tools (UML has been around for a while).  I wanted to take a look at what is out there to get a sense for how these tools are evolving.

Below is a slice if you will through what are some next generation offerings in software development, tools that are trying to do something different, and some well established old-guard tools that everyone has heard of and compares all comers too.

Code Canvas Example

Debugger Canvas  Debugger Canvas by Microsoft (see video) is based on Code Canvas which was developed at Microsoft Research in  collaboration with the Code Bubbles folks from Brown.  Debugger Canvas is available to premium Microsoft Visual Studio license holders.  I love how you can view a GUI widget, its documentation, and implementation side by side in one clean view.  The development metaphor is very different from a traditional IDE.

 

read more »

 

Code Visibility: one factor of code quality that you shouldn’t forget

Posted in Agile & Development Methodologies, Design Patterns & Architecture, Developer Tools, UML & Diagramming on July 13th, 2011 by xin Zhou2 Comments

Every developer cares about code quality. But how do you maintain code quality throughout the software development cycle? Readability, modularity, and efficiency all are important factors of writing good code but there isn’t much agreement on the best way to maintain a high level of code quality.

One factor which is often missed in discussions is code visibility, or making sure your code has a clear structure so that others can easily understand it. (Take a look at the diagram above for some of the difficulties encountered when there is a lack of code visibility).
read more »

 

A simple intro to creating a MVC framework: Using GEF

Posted in Design Patterns & Architecture, Eclipse, Java, Libraries & Frameworks on April 10th, 2011 by Abhishek RakshitBe the first to comment

When creating a rich graphical editor the Model View Controller (MVC) design pattern makes life a lot easier. But it is often difficult to decide which libraries/frameworks to use. On the Eclipse platform GEF (Graphical Editing Framework) is a great solution but it can be challenging to figure out how to integrate with the parts you need. Since GEF is built on top of the Draw2d/SWT graphical libraries and is able to provide a powerful and consistent UI. However there are many considerations and pitfalls to take into account when getting started with GEF.

Some of my first large scale Java coding involved using and modifying GEF code. Luckily the GEF team provides many helpful examples showcasing the different features GEF offers. I will attempt to provide a concise introduction to the points that I found best helped me understand GEF.
read more »

 

REST Architecture – Simplified

Posted in Agile & Development Methodologies, Design Patterns & Architecture, Java on November 14th, 2010 by Abhishek Rakshit7 Comments

Recently, while working on some collaboration functionality for our suite I got a chance to work on a REST (Representational State Transfer) based web server. There are many great resources about REST out there but most of them are quite technical and it took a me a while to get it. So, in this post I am trying to explain in some simple terms what I have understood about REST. read more »

 

Wasting Time With Test Driven Development?

Posted in Agile & Development Methodologies, Design Patterns & Architecture on August 5th, 2010 by Vineet Sinha12 Comments

Many teams are moving to test driven development and very often this a good thing. In a drive towards increased code stability and maintainability, good test cases can be very helpful. But this is not always the case; while working with development teams, most teams seem to have one or more critical problems. It seems that it is easy to do Test Driven Development (TDD) badly – below are five situations that I have seen multiple times.
read more »

 

Commands and the MVC architecture

Posted in Design Patterns & Architecture on June 12th, 2010 by Abhishek RakshitBe the first to comment

Most of us agree to the benefits of using commands to provide the undo-redo functionality in an MVC based application. Working on one such highly interactive application, the question which often arises is where in the code base do the commands belong: in the model, in the controller or as a separate entity. This issue has been discussed before and people seem to have quite disparate views implying a vague understanding of this problem. In my view commands should be considered separate from both the model as well as the controller. This becomes really important while organizing your code to have clear abstraction boundaries and conform with the principles of cohesion and couplingread more »

 

Cohesion and Coupling in Large Projects

Posted in Design Patterns & Architecture on June 1st, 2010 by Abhishek RakshitBe the first to comment

Cohesion and Coupling are commonly used metrics to gauge the design quality of a software project with regards to maintainability, reuse and understandability. These issues are commonly faced by developers working with large codebases. The mantra for these issues is to have a highly cohesive and loosely coupled codebase.

Simply stating, Cohesion means placing related code in one particular unit and Coupling is the degree of dependency between two or more units. If the code is highly coupled i.e. different units depend a lot on each other and modifying one feature can cause unwanted side effects. To avoid these the developer has to understand each of the related classes to update the behavior safely. Loosely coupled code is easier to reuse and on modification does not have undesired ripple effects in the code base. Adding to the benefits highly cohesive code promotes easy code understandability as everything is placed closely together. These aspects are not restricted to classes but apply to everything from methods in a class to packages in a project.

read more »

 

No, You are not Dumb! Programmers do spend a lot of time Understanding Code…

Posted in Design Patterns & Architecture, Documentation & Communication on May 5th, 2010 by Vineet Sinha10 Comments

While working on a codebase, developers spend a lot of time understanding code. We might be unwilling to admit it for fear of sounding dumb but the huge amount of time spent on making sense of code is staggering. In fact a conference is held every year just to tackle this problem. The good news is that with the emergence of online communities more and more people are discussing the challenges of working with large codebases openly.

read more »

 

Types of Dependency Injection

Posted in Design Patterns & Architecture, Libraries & Frameworks on May 4th, 2010 by Abhishek Rakshit1 Comment
In continuation with my effort of trying to simplify Dependency Injection, I want to elaborate on the different types of injection. Dependency Injection is decoupling an application and service so that the application does not need to know anything about the service implementation. Dependency injection can be broadly classified in three categories: Constructor, Setter and Interface.

Object dependencies when passed as parameters to a constructor is termed as Constructor Injection.

public class Account {
  public User user;
  public Account (User user) {
   this.user = user;
  }
}

Pico Container is a framework which prefers constructor injection. Constructor injection ensures that the application object is created with all its service dependencies satisfied. read more »