Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Saturday, March 27, 2010

C# implementation of Builder pattern

The builder pattern Separates the construction of a complex object from its representation.

The players in this pattern are:
1. Product (Room)
Represents the complex object which includes many classes(parts)
2. Builder (RoomBuilder)
Specifies an abstract class or an interface for creating parts of a Product object
3. ConcreteBuilder (WoodBuilder, GlassBuilder)
  • Constructs parts of the product by implementing the Builder class/interface
  • provides a way for retrieving the product
4. Director (House)
Constructs an object (room) using the Builder class/interface

So, you use the Builder pattern when:

  • the object to be constructed has many parts and might have different representations.
  • you need control over the construction process.

Sunday, March 14, 2010

Java vs C# Performance Benchmarking

I'm a Java fan, but I use C# 99% in my job, so yesterday I was looking at a good EJB book (EJB 3 in action) while enjoying my coffee (the real one not the Java one ;).
I had a look at some EJB vs .NET benchmarks and I was shocked to see that .NET is much more faster than Java in the enterprise wild, so I decided to do some SIMPLE benchmarking myself.

Benchmarking Tests
I've wrote 3 really simple tests in both Java and C#, the first tests simply loops over an array 1000,000 times while doing some multiplication math, the second test loops over an array 1000,000 times too but while doing some more complex math, and finally the final tests that creates 1000,000 objects and saves them in an array.

I repeated each test 100 times, took the average of them as a final result, so I can be sure of the accuracy.

Monday, October 12, 2009

Easy ArcGIS Library Initiated

I'm glad to announce the birth of my new project Easy ArcGIS Library or (EAGL) ;)
EAGL is a set for .net assemblies that make working with ArcGIS common tasks easy and direct.
EAGL is an example of the Facade design pattern where you have a complex system with a lot of functionalities (ArcObjects) and you access 20% of this functionality 80% of times.
EAGL will make accessing that 20% part easy an direct.

I've hosted my new project on Google codes, and I'm using subversion as my revision control system.
EAGL was created using C# .net (3.5).

All contributors are welcome, we need for now a documentation writer ;)

Download EAGL 1.0 from here