Ali Özgür - The Pragmatic Developer

My Amazon.com Wish List

RecentComments

Comment RSS

Downloads

Original project is here

Modified binaries: IIS_LogAnalyzer_Bin.rar (360.01 kb)

Patch file : Indihiang_LogAnalyzer_FTPSupport.patch (170.94 kb)

Screen Shots

 

 


 

Note for Vista Users

Modified version creates a TempDir under the application installation folder and downloads files there. Vista does not allow regular user to create directories under Program files so if you install the application under Program Files , right click on the Indihiang.exe, click Properties and check "Run this program as an administrator" option found in Compatibility page.

 


GoF book says that "Observer pattern should defina a one-to-many dependency between objects so that when one object changes state, all its dependenst are notified and updated automatically". Subscribing to RSS feeds is a nice analogy.  You subscribe to RSS feeds to show interest and you become an observer who demand for notification and RSS feeds become the subject and are responsable for providing information to all subscribers. I think this bit of information describing the pattern is enough, now lets see how we implement observer pattern.
More...


Posted in: C# , GoF Patterns  Tags:

I believe Factory Pattern is one of the most known pattern in development community. Simply Factory Pattern states that we have a factory object which is used to create other objects. But GoF specification for the Factory Pattern is a little bit different. GoF book says that "We should define an interface for creating an object, but let subclasses decide which class to instantiate."
More...


Posted in: C# , GoF Patterns  Tags:

Download Source(23,52 kb)

We have different kind of vehicle implementations inherited from an abstract Vehicle class. Our code looks like this

001    //Abstract Vehicle class
002
003    public abstract class Vehicle
004
005    {
006
007        public abstract string Description { get; }
008
009
010
011    }
012
013    
014
015    //Concrete implementation
016
017    public sealed class Car : Vehicle
018
019    {
020
021        public override string Description
022
023        {
024
025            get { return "Car"; }
026
027        }
028
029    }
030
031
032
033    //Concrete implementation
034
035    public sealed class Helicopter : Vehicle
036
037    {
038
039        public override string Description
040
041        {
042
043            get { return "Helicopter"; }
044
045        }
046
047    }
048
049
050
051    //Concrete implementation
052
053    public sealed class Jet : Vehicle
054
055    {
056
057        public override string Description
058
059        {
060
061            get { return "Jet"; }
062
063        }
064
065    }

Suppose that our client wants to rent these different kind of vehicles and print vehicle information plus rental specific info such as FromDate, ToDate and the customer's name. We could implement this requirement by adding those new properties to our base Vehicle class in order to meet our customer's need. We also have to modify our concrete Vehicle classes so thet they can provide rental information through their Description property.

Here is our modified Vehicle class More...


Posted in: C# , GoF Patterns  Tags:

I'm sure that you have already heard at least one of the following common design/development tips

  • Seperate out parts of code that will be subject to change over time from the rest of your code
  • Use has-a relationship instead of is-a relationship where possible, that is prefer composition over inheritance

Strategy pattern helps us to realize these tips in our designs. By applying the Strategy Pattern we move our algorithm implementations, which are possible source of maintainance issues, away from the more stable source code.

Download

GoF_Patterns_Strategy.rar (19,76 kb)

Recommended Reading 

Design Patterns For Dummies by Steve Holzner 

Example Implementation 

In our sample scenario we have different kind of vechicles all supporting some kind of Go behaviour. More...


Posted in: C# , GoF Patterns  Tags: