January 14, 2014

Refactoring

Refactoring

Definition: I will go with the dictionary definition

Refactoring (noun): A change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior.

Refactor:

So, what is refactoring?

Does it mean just cleaning of code, the answer is just, but I feel it’s more than just cleaning code. Refactoring provides a technique for cleaning code in a more controlled manner and efficiently.

Developer productivity will increase the more they learn about refactoring methods, the more they use them the more they can reduce bugs in their code.

Purpose of refactoring:
  1. Make the code easier to understand and modify
  2. Refactoring make little or no changes to the overall functionality of the component (observable behavior)
  3. Like Performance tuning – helps in improving the speed of the application, without altering the actual functionality, similarly refactoring help in cleaning small amount of internal code without changing the actual functionality. 
In next post i will start with other refactoring methods

Thanks,
Hussain Patel


January 13, 2014

Categories of Patterns - Design Pattern

Types of Design Patterns

As mentioned in earlier post, there are 3 categories of deign patterns.
  1. Creational Patterns
  2. Structural patterns
  3. Behavioral Patterns
Creational patterns
The names creational itself conveys, that the design patterns under this category, all revolve around object creation in terms of who, what, how and when. Creational patterns all the systems separate the process of object creation, composition and representation. Creational pattern hide the detail of how the object / instance of classes are created.


Patterns falling under this category are:
  • Singleton pattern
  • Factory pattern
  • Abstract factory pattern
  • Prototype and 
  • Builder pattern
Structural patterns
Structural patterns revolve around the class and object composition, what I mean is it helps us to understand how different classes in a system are glued together in a extensible and flexible manner. The object composition shows ways to compose objects to obtain new functionality.

Patterns falling under this category are
  • Adapter pattern
  • Bridge
  • Composite
  • Façade
  • Proxy
  • Flyweight
  • Decorator
Behavioral pattern
Describe the way object and classes behave / interact and divide the responsibility among them. Thee pattern are more concerned with the communication between objects and classes.

Pattern falling under this category are:
  • Command
  • Interpreter
  • Iterator
  • Mediator
  • Observer
  • State
In the next post I will tart explaining in detail patterns falling under Creational pattern


Thanks,
Husain Patel

Installing IIS 8.0 in windows 2012

Installing IIS 8.0 on windows 2012 and Windows 8.0

Note: IIS 8.0 is only available on windows 8.0  and windows 2012.
IIS is cannot installed as per the traditional method in windows 2012, the introduction of Server Manager in 2012 has changed the user experience as well

Prerequisites:
  • Windows Server 2012 has been installed.
Below are the step-by-step instructions for installing IIS.  (Note: the steps below are for installing IIS with default settings.)
  1. Open Server Manager.          
  2. Under Manage menu, select Add Roles and Features:
  3.  Select Role-based or Feature-based Installation:
  1. Select the appropriate server (local is selected by default), as shown below:
  1. Select Web Server (IIS):         
  1. No additional features are needed for IIS, so click Next:
  1. Click Next:                              
  1. Customize your installation of IIS, or accept the default settings that have already been selected for you, and then click Next:         
  1. Click Install:                            

  2. When the IIS installation completes, the wizard reflects the installation status:
  3. Click Close to exit the wizard.   
Thanks,
Hussain Patel

January 12, 2014

Chromecast

Hi,

Yesterday i got a chrome-cast for $35 for tax, and here are some of my review comments.

Pros and cons

Pros

  • Easy to setup the devices
  • Quick install of the software
  • Easy /two click cast
  • Sharing Desktop (Crashes sometimes)
  • Streams you tube and chrome apps from dongle rather from the laptop / tablet
Cons
  • Needs Chrome to be installed for casting internet stuff
  • Does not allow screen extending. ( i know its a streaming dongle)
  • Only Google apps ( are cast in full screen) - eg - you tube
  • app that are not tied to Google are not cast full screen, so user cannot do any thing if the laptop screen is made full.
More details on this..

Hussain Patel


Hussain’s Quest…

Thanks for reading my new blog. I welcome you all.
Who am I?
  • A Developer /Consultant
  • Photographer / Capturing world in pixels - Passion (http://digitaldays2.blogspot.com)
  • Travel freak 
  • Loves cooking the most / Eating variety of foods..
  • Learning to Speak different languages
  • Whistling on Songs..
I was born in India. I grew up in Mumbai and have a post-graduate degree in Computer Management . Currently am working for a software company; 
What this blog contains? 
This blog  is  my quest – Search for something and everything … , It contains good Quotes, travel guides, entrepreneurship, motivation, productivity, tips & tricks, links and hacks and more. It is also an online diary of my quest for all.. and everything I think about. 
If you are someone like me and share the same quest like me, motivated, inspired and wondering to be something of your own, you might find some of my post useful..

Signing off
Hussain

Opportunities!

You create your opportunities by asking for them.  -Shakti Gawain

Mistake… Humans

The Greatest mistake we HUMANS make in our Relationships: “We listen Half,Understood Quarter , Think Zero and React DOUBLE !!! :)..

January 2, 2014

Displaying Curly Braces { } in Console ouptut

Recently I was working on a sample console application for my tutorial and I happen to have a requirement, where in I had to display the curly braces as part of the formatted output.
Here’s the example ; Output of the console program should be: The number is -{124}
Solution:
As you are completely aware that curly braces is part of the c# keywords, for formatting object (e.g. numeric or string or class object etc.)
{
string x = “124″;
Console.WriteLine(“The number is -{x}”, x);
}
output : The number is -124
in the above example the output is still missing the curly braces, the solution to this is adding twice open and close {{ }} curly braces to get the desired output. Note is only for curely braces for all other special characters you need to use ‘\’
{
string x = “124″;
Console.WriteLine(“The number is -{{x}}”, x);
}
output : The number is -{124}
Thanks,
Hussain Patel