New Indian Rupee(INR) Symbol and Font

The New Rupee Sign, Download here

So India’s Rupee has a new symbol!!!!! But how do you use on your computer??

Well, it will take some time to officially include in the Unicode Character set to be able to use it everywhere: computers, mobile phones, internet etc. Because it has to be included in  the character set by Unicode Consortium, which will take at least 3-4 months.

So, here is a font that can be used in the meantime.

Download Link1 Link2

About the Font:

Some other people have also made font for Rupee sign, all of them are mapped to normal characters available on the keyboard. It makes it easy to insert the symbol, just type the relevant key, change the font, done. Sounds simple, but there’s a catch. Every time you need to insert the symbol, you need to change the font for the symbol, then change the font back for the rest your text. Moreover, if you select the whole text and change the font, the symbol font will change to actual the character that it was mapped to, like if it mapped to # sign, # will appear in the text instead of the new Rupee sign.

Hence I have mapped the sign to the Rupee (Rs) sign available in Unicode character set, which is embedded to Unicode character U+20A8. So, if you send a file containing the symbol to someone else, and if that person does not have this font installed, the old Rs. symbol will be shown in that person’s computer instead of the new symbol. This is much better then showing some other character.

How to use?

First, download the font and install on your computer.

To use in MS-Word, do as follows:

Goto Insert > Symbol

For Office 2007 or 2010, select More Symbol

This will bring up the Symbol Dialogue Box.

Select Indian Rupees font in the font drop down list.

Now, select the symbol, and click Insert. (There is one more character in the font, surprise!)

That’s it………

There are few other ways you can insert the sign.

  • Insert from Character Map in Windows. Click Start button, then run, then type charmap and Enter. Then do as above.
  • Hold alt key and type 8360 in your numeric key pad. If you see Rs instead of the new symbol, then select it and change the font to Indian Rupee.
  • You can also set a shortcut key in MS-Word. Go to Insert Symbol as above, select the Indian Rupee font, then click on the Shortcut Key button. Now press & hold alt key and then any that you would like to assign.  Like, you can assign it to alt+R. Then, whenever you press alt+R, the symbol will be inserted. This is the easiest method.

The above procedures can be used any Office application.

Download Link1 Link2

Abstract Factory Pattern – Creational Patterns

Download Sample Here

The Abstract Factory pattern is one level of abstraction higher than the factory pattern. You can use this pattern when you want to return one of several related classes of objects, each of which can return several different objects on request. In other words, the Abstract Factory is a factory object that returns one of several factories.

One classic application of the abstract factory is the case where your system needs to support multiple “look-and-feel” user interfaces, such as Windows-9x, Motif or Macintosh. You tell the factory that you want your program to look like Windows and it returns a GUI factory which returns Windows-like objects. Then when you request specific objects such as buttons, check boxes and windows, the GUI factory returns Windows instances of these visual interface components.

In Java 1.2 the pluggable look-and-feel classes accomplish this at the system level so that instances of the visual interface components are returned correctly once the type of look-and-feel is selected by the program. Here we find the name of the current windowing system and then tell the PLAF abstract factory to generate the correct objects for us.

String laf = UIManager.getSystemLookAndFeelClassName();

try {

UIManager.setLookAndFeel(laf);

}

catch (UnsupportedLookAndFeelException exc){

System.err.println(“UnsupportedL&F: ” + laf);

}

catch (Exception exc){

System.err.println(“Error loading ” + laf);

}

This pattern is one level of abstraction higher than factory pattern. This means that the abstract factory returns the factory of classes. Like Factory pattern returned one of the several sub-classes, this returns such factory which later will return one of the sub-classes.

Let’s understand this pattern with the help of an example given in the sample code. Suppose we need to get the specification of various parts of a computer based on which work the computer will be used for.

The different parts of computer are, say Monitor, RAM and Processor. The different types of computers are PC, Workstation and Server.  So, here we have an abstract base class Computer. This class, as you can see, has three methods all returning different parts of computer. They all return a method called Parts. The specification of Parts will be different for different types of computers. Let’s have a look at the class Parts. And now let’s go to the sub-classes of Computer. They are PC, and Server.

When to use Abstract Factory Pattern?

One of the main advantages of Abstract Factory Pattern is that it isolates the concrete classes that are generated. The names of actual implementing classes are not needed to be known at the client side. Because of the isolation, you can change the implementation from one factory to another.

Download Sample Here

Builder Pattern – Creational Pattern

Download Sample Here

The Builder Pattern is a software design pattern. The intention is to abstract steps of construction of objects so that different implementations of these steps can construct different representations of objects.

The Builder Pattern separates the construction of a complex object from its representation, so that several different representations can be created depending on the needs of the program.

Often, the Builder Pattern is used to build Products in accordance to the Composite pattern, a structure pattern.

Class Diagram

Class Diagram representation of Builder Pattern

Class Diagram of Builder Pattern

Builder: Abstract interface for creating objects (product).

Concrete Builder: Provide implementation for Builder. Construct and assemble parts to build the objects.

Director: The Director class is responsible for managing the correct sequence of object creation. It receives a Concrete Builder as a parameter and executes the necessary operations on it.

Product: The Product is the final object that will be created by the Director using Builder.

  • Builder focuses on constructing a complex object step by step. Abstract Factory emphasizes a family of product objects (either simple or complex). Builder returns the product as a final step, but as far as the Abstract Factory is concerned, the product gets returned immediately.
  • Builder often builds a Composite.
  • Often, designs start out using Factory Method (less complicated, more customizable, subclasses proliferate) and evolve toward Abstract Factory, Prototype, or Builder (more flexible, more complex) as the designer discovers where more flexibility is needed.
  • Sometimes creational patterns are complementary: Builder can use one of the other patterns to implement which components are built. Abstract Factory, Builder, and Prototype can use Singleton in their implementations.

Consequences of the Builder Pattern

  •  A Builder lets you vary the internal representation of the product it builds. It also hides the details of how the product is assembled.
  •  Each specific builder is independent of the others and of the rest of the program. This improves modularity and makes the addition of other builders relatively simple.
  •  Because each builder constructs the final product step-by-step, depending on the data, you have more control over each final product that a Builder constructs.
  • A Builder pattern is somewhat like an Abstract Factory pattern in that both return classes made up of a number of methods and objects. The main difference is that while the Abstract Factory returns a family of related classes, the Builder constructs a complex object step by step depending on the data presented to it.

Download Sample Here