1. In Simple Factory we have a Factory Class(LoggerFactory.java) and We call the createLogger method which returns different implementation of logger
  2. Logger is a abstract class which has different implementations

Logger.java

public abstract class Logger {
  abstract void log(String logstring);
}

ConsoleLogger.java

public class ConsoleLogger extends Logger{
    @Override
    void log(String logstring) {
        System.out.println("Logging to Console - "+ logstring);
    }
}

DBLogger.java

public class DBLogger extends Logger{
    @Override
    void log(String logstring) {
        System.out.println("Logging to Database - "+ logstring);
    }
}

FileLogger.java

public class FileLogger extends Logger{
    @Override
    void log(String logstring) {
        System.out.println("Logging to File - "+ logstring);
    }
}

LoggerFactory.java

public class LoggerFactory {
    public enum LoggerType {
        DATABASE, FILE, CONSOLE;
    }

    //The same code could be written using if else block instead of switch case
    public Logger createLogger(LoggerType loggerType) {
        Logger logger;

        switch (loggerType) {
            case FILE:
                logger = new FileLogger();
                break;
            case DATABASE:
                logger = new DBLogger();
                break;
            case CONSOLE:
                logger = new ConsoleLogger();
                break;
            default:
                logger = new ConsoleLogger();
                break;
        }

        return logger;
    }
}

ClientApp.java

public class ClientApp {
    public static void main(String[] args) {
        LoggerFactory objLoggerFactory = new LoggerFactory();
        Logger logger = objLoggerFactory.createLogger(LoggerFactory.LoggerType.CONSOLE);
        logger.log("Hello there");
    }
}

Output

Logging to Console - Hello there

A flat interest rate means that the amount of interest paid is fixed and does not reduce as time moves on. In other words, the amount of payable interest does not decrease as the loan gets paid off each month.

if you take a loan of Rs 1, 00,000 with a flat rate of interest of 10% p.a. for 5 years, then you would pay:

Rs 20,000 (principal repayment @ 1, 00,000 / 5) + Rs 10,000 (interest @10% of 1, 00,000) = Rs 30,000 every year or Rs 2,500 per month.

Over the entire period, you would actually be paying Rs. 1, 50,000 (2,500 * 12* 5). Therefore, in this example, the monthly EMI of Rs. 2,500 converts to an Effective Interest Rate of 17.27% p.a.

Advantage
During a regime of credit restriction interest rates rise high, if repo rate is increased. So many borrower prefer flat interest rate to reduce interest liability over the sanction term.

Disadvantage
If there is no credit restriction, interest rates come down due to easy availability of credit. At that time flexible interest rate is preferable as interest burden goes down.

The reducing interest rate on the other hand means that as a payment is made on the principal amount of a loan, the interest payment reduces as well.

if you take a loan of Rs 1, 00,000 with a reducing rate of interest of 10% p.a. for 5 years, then your EMI amount would reduce with every repayment. In the first year, you would pay Rs 10, 000 as interest; in the second year you would pay Rs. 8,000 on a reduced principal of Rs. 80,000 and so on, till the last year, you would pay only Rs. 2,000 as interest. Unlike the fixed rate method, you would end up paying Rs. 1.3 lakh instead of Rs. 1.5 lakh.

Flat interest rates generally range from 1.7 to 1.9 times more when converted into the Effective Interest Rate equivalent.

To convert the Flat to Reducing Interest rate multiply by 1.8.

Why RBI banned Zero EMI

In general, as interest rates are lowered, more people are able to borrow more money. The result is that consumers have more money to spend, causing the economy to grow and inflation to increase. The opposite holds true for rising interest rates.

How could any bank offer any loan at Zero percent when they borrow at a cost from a depositor, pay salaries, rent, admin etc. So they must be charging the customer in some manner to get a return but show zero percent ROI to customer. RBI thought this is not a transparent and fair practice and so stopped it.

certain banks where charging hidden fees from the customers or getting discounts from the manufacturer and not passing it through to the Consumer

Why RBI hikes interest Rates to curb Inflation
Inflation, by definition, is an increase in the price of goods and services within an economy. It’s caused due to an imbalance in the goods and buyer ratio – when the demand of goods or services in an economy is higher than the supply, prices go up. Inflation isn’t necessarily a bad thing. It’s often an indicator of a robust economy and the government usually takes into account a yearly rate of 2% to 3% when it comes to an increase in inflation.

The interest rate is the rate at which interest is paid by borrowers for the use of money that they borrow from creditors.

Lower interest rates translate to more money available for borrowing, making consumers spend more. The more consumers spend, the more the economy grows, resulting in a surge in demand for commodities, while there’s no change in supply. An increase in demand which can’t be met by supply results in inflation.

Higher interest rates make people cautious and encourage them to save more and borrow less. As a result, the amount of money circulating in the market reduces. Less money, of course, would mean that consumers find it more difficult to buy goods and services. The demand is less than the supply, the hike in prices stabilise, and sometimes, prices even come down.

A growing economy might sound like music to your ears, but if you think about it, an economy growing at an alarming rate might not really be the best thing.

In a stable and healthy economy, wage and inflation rise in hand in hand.


A cut in the interest rates right now will devalue the Rupee further. Imports will be more expensive. Inflation will go up.

The ‘Rule of 72‘ is a simplified way to determine how long an investment will take to double, given a fixed annual rate of interest. By dividing 72 by the annual rate of return, investors can get a rough estimate of how many years it will take for the initial investment to duplicate itself

Years to double investment = 72/compound annual interest rate

Comparable is for objects with a natural ordering. The object itself knows how it is to be ordered.If any class implement Comparable interface in Java then collection of that object either List or Array can be sorted automatically by using Collections.sort() or Arrays.sort() method and object will be sorted based on there natural order defined by CompareTo method.

Comparator is for objects without a natural ordering or when you wish to use a different ordering.

Natural ordering is the Ordering implemented on the objects of each class. This ordering is referred to as the class’s natural ordering.For example Strings Natural Ordering is defined in String Class

Comparable
Compares object of itself with some other objects.Comparable overrides compareTo

Employee.java

package com.acme.users;

public class Employee implements Comparable<Employee> {
	public String EmpName;
	public Integer EmpId;
	public Integer Age;
	
	public Employee(Integer pEmpId, String pEmpName, Integer pAge)
	{
		this.EmpName = pEmpName;
		this.EmpId   = pEmpId;
		this.Age     = pAge;
	}
	
	
	public String getEmpName() {
		return EmpName;
	}
	public void setEmpName(String empName) {
		EmpName = empName;
	}
	public Integer getEmpId() {
		return EmpId;
	}
	public void setEmpId(Integer empId) {
		EmpId = empId;
	}
	public Integer getAge() {
		return Age;
	}
	public void setAge(Integer age) {
		Age = age;
	}
	
	@Override
	public int compareTo(Employee arg0) 
	{	
		if(this.getEmpId() == arg0.getEmpId())
			return 0;
		else if (this.getEmpId() > arg0.getEmpId())
			return 1;
		else
			return -1;
	}
}

EmpDashBoard.java

package com.acme.users;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class EmpDashBoard {
	public static void main(String[] args) {

		List<Employee> arrEmpList = new ArrayList();

		Employee objEmp1 = new Employee(101, "Ahmed", 31);
		Employee objEmp2 = new Employee(127, "Mahesh", 24);
		Employee objEmp3 = new Employee(109, "Viparna", 85);
		Employee objEmp4 = new Employee(101, "Abdul", 26);
		Employee objEmp5 = new Employee(104, "Muthu", 23);
		Employee objEmp6 = new Employee(115, "Monalisa", 25);

		arrEmpList.add(objEmp1);

		arrEmpList.add(objEmp2);
		arrEmpList.add(objEmp3);
		arrEmpList.add(objEmp4);
		arrEmpList.add(objEmp5);
		arrEmpList.add(objEmp6);

		System.out.println("Sorted based on Natural Sorting(Emp Id)");
		System.out.println("Before Sorting");
		dispListContent(arrEmpList);
		
		Collections.sort(arrEmpList);
		
		System.out.println("After Sorting");
		dispListContent(arrEmpList);
	}

	public static void dispListContent(List<Employee> parrEmployeeLst) {
		System.out.println(" ");

		System.out.println("EmpId" + " " + "EmpName" + "     " + "Age");
		System.out.println("---------------------------");
		for (Employee object : parrEmployeeLst) {
			System.out.print(object.getEmpId() + "   ");
			System.out.print(object.getEmpName() + "     ");
			System.out.println(object.getAge() + " ");
		}
	}
}

Output

Sorted based on Natural Sorting(Emp Id)

Before Sorting
 
EmpId EmpName     Age
---------------------------
101   Ahmed       31 
127   Mahesh      24 
109   Viparna     85 
101   Abdul       26 
104   Muthu       23 
115   Monalisa    25 

After Sorting
 
EmpId EmpName     Age
---------------------------
101   Ahmed       31 
101   Abdul       26 
104   Muthu       23 
109   Viparna     85 
115   Monalisa    25 
127   Mahesh      24 

Comparator
In some situations, you may not want to change a class and make it comparable. In such cases, Comparator can be used.Comparator overrides compare

Comparator provides a way for you to provide custom comparison logic for types that you have no control over.

In the below Example I have Sorted the Employee class Objects based on Name(EmpNameComparator), Age(EmpAgeComparator) and based on EmpIDName(EmpIdNameComparator)

EmpDashBoard.java

package com.acme.users;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class EmpDashBoard {
	public static void main(String[] args) {

		List<Employee> arrEmpList = new ArrayList();

		Employee objEmp1 = new Employee(101, "Ahmed", 31);
		Employee objEmp2 = new Employee(127, "Mahesh", 24);
		Employee objEmp3 = new Employee(109, "Viparna", 85);
		Employee objEmp4 = new Employee(101, "Abdul", 26);
		Employee objEmp5 = new Employee(104, "Muthu", 23);
		Employee objEmp6 = new Employee(115, "Monalisa", 25);

		arrEmpList.add(objEmp1);

		arrEmpList.add(objEmp2);
		arrEmpList.add(objEmp3);
		arrEmpList.add(objEmp4);
		arrEmpList.add(objEmp5);
		arrEmpList.add(objEmp6);

		System.out.println("Sorted based on Natural Sorting(Emp Id)");

		System.out.println("Before Sorting");
		dispListContent(arrEmpList);

		System.out.println("Sorting based on Emp Name");
		Collections.sort(arrEmpList, new EmpNameComparator());
		dispListContent(arrEmpList);

		System.out.println("Sorting based on Emp Age");
		Collections.sort(arrEmpList, new EmpAgeComparator());
		dispListContent(arrEmpList);

		System.out.println("Sorting based on EmpId and Name");
		Collections.sort(arrEmpList, new EmpIdNameComparator());
		dispListContent(arrEmpList);
	}

	public static void dispListContent(List<Employee> parrEmployeeLst) {
		System.out.println(" ");

		System.out.println("EmpId" + " " + "EmpName" + "     " + "Age");
		System.out.println("---------------------------");
		for (Employee object : parrEmployeeLst) {
			System.out.print(object.getEmpId() + "   ");
			System.out.print(object.getEmpName() + "     ");
			System.out.println(object.getAge() + " ");
		}
	}
}

EmpNameComparator.java

public class EmpNameComparator implements Comparator<Employee>{

	@Override
	public int compare(Employee o1, Employee o2) {
		String a = o1.getEmpName();
		String b = o2.getEmpName();
		
		//Strings Natural Order Comparable Method
		int compare = a.compareTo(b);
		
		if (compare > 0){
		    return 1;
		}
		else if (compare < 0) {
			return -1;
		}
		else {
			return 0;
		}
	}
}

EmpAgeComparator.java

public class EmpAgeComparator  implements Comparator<Employee> {
	
	@Override
	public int compare(Employee o1, Employee o2) {
		Integer a = o1.getAge();
		Integer b = o2.getAge();
		
		if (a > b){
		    return 1;
		}
		else if (a < b) {
			return -1;
		}
		else {
			return 0;
		}
	}
}

EmpIdNameComparator.java

public class EmpIdNameComparator  implements Comparator<Employee>{
	
	@Override
	public int compare(Employee o1, Employee o2) {
		String a = o1.getEmpName();
		String b = o2.getEmpName();
		
		
		int i = Integer.compare(o1.getEmpId(), o2.getEmpId());
		if (i != 0) return i;

	    return a.compareTo(b);
	}
	
}

Output

Before Sorting
 
EmpId EmpName     Age
---------------------------
101   Ahmed      31 
127   Mahesh     24 
109   Viparna    85 
101   Abdul      26 
104   Muthu      23 
115   Monalisa   25 

Sorting based on Emp Name
 
EmpId EmpName     Age
---------------------------
101   Abdul      26 
101   Ahmed      31 
127   Mahesh     24 
115   Monalisa   25 
104   Muthu      23 
109   Viparna    85 

Sorting based on Emp Age
 
EmpId EmpName     Age
---------------------------
104   Muthu       23 
127   Mahesh      24 
115   Monalisa    25 
101   Abdul       26 
101   Ahmed       31 
109   Viparna     85 

Sorting based on EmpId and Name
 
EmpId EmpName     Age
---------------------------
101   Abdul       26 
101   Ahmed       31 
104   Muthu       23 
109   Viparna     85 
115   Monalisa    25 
127   Mahesh      24 


comparable for natural order, (natural order definition is obviously open to interpretation), and write a comparator for other sorting or comparison needs.

If there is a natural or default way of sorting Object already exist during development of Class than use Comparable. This is intuitive and you given the class name people should be able to guess it correctly like Strings are sorted chronically, Employee can be sorted by there Id etc. On the other hand if an Object can be sorted on multiple ways and client is specifying on which parameter sorting should take place than use Comparator interface. for example Employee can again be sorted on name, salary or department and clients needs an API to do that. Comparator implementation can sort out this problem.

Dependency Injection

What is Dependency

Quick Example:EMPLOYEE OBJECT WHEN CREATED,
              IT WILL AUTOMATICALLY CREATE ADDRESS OBJECT
   (if address is defines as dependency by Employee object)

Now in the above EMPLOYEE Class is dependent on ADDRESS Class.

You can not create the Address Object unless you create Employee Object

EMPLOYEE Class is dependent and ADDRESS Class is dependency

What is the purpose of DI?
With dependency injection, objects don’t define their dependencies themselves, the dependencies are injected to them as needed.The purpose of Dependency Injection is to reduce coupling in your application to make it more flexible and easier to test.

How does it benefit ? The objects don’t need to know where and how to get their dependencies, which results in loose coupling between objects, which makes them a lot easier to test.

When to use Dependency Injection
One of the most compelling reasons for DI is to allow easier unit testing without having to hit a database and worry about setting up ‘test’ data.Dependency Injection gives you the ability to test specific units of code in isolation.

Dependency injection is basically providing the objects that an object needs (its dependencies) instead of having it construct them itself. It’s a very useful technique for testing, since it allows dependencies to be mocked or stubbed out.

Dependencies can be injected into objects by many means (such as constructor injection or setter injection). One can even use specialized dependency injection frameworks (e.g Spring) to do that, but they certainly aren’t required.

Example
A Car depends on wheels, engine, fuel, battery, etc. to run. Traditionally we define the brand of such dependent objects along with the definition of the Car object

Without Dependency Injection (DI):

class Car
{
  private Wheel wh   = new ApolloWheel();
  private Battery bt = new ExideBattery();

  //The rest
}

Here, the Car object is responsible for creating the dependent objects.

What if we want to change the type of its dependent object – say Wheel – after the initial ApolloWheel() punctures? We need to recreate the Car object with its new dependency say SpareWheel(), but only the Car manufacturer can do that.

Then what does the Dependency Injection do us for…?

When using dependency injection, objects are given their dependencies at run time rather than compile time (car manufacturing time). So that we can now change the Wheel whenever we want. Here, the dependency (wheel) can be injected into Car at run time.

After using dependency injection:

class Car
{
  private Wheel wh   = [Inject an Instance of Wheel at runtime];
  private Battery bt = [Inject an Instance of Battery at runtime];

  Car(Wheel wh,Battery bt) 
  {
      this.wh = wh;
      this.bt = bt;
  }

  //Or we can have setters
  void setWheel(Wheel wh) 
  {
      this.wh = wh;
  }
}

Lets take the below example

public class Foo
{
    private Bar _bar;

    public Foo(Bar bar)
    {
        _bar = bar;
    }

    public bool IsPropertyOfBarValid()
    {
        return _bar.SomeProperty == PropertyEnum.ValidProperty;
    }
}

without dependency injection the Bar object is dependent and tightly coupled with Foo class like below

public class Foo
{
    private Bar _bar = new Bar();
    .
    . 
}

But by using dependency injection like before code you can mock the Bar Object at runtime and call the IsPropertyOfBarValid() method over it.

IoC is a generic term meaning rather than having the application call the methods in a framework, the framework calls implementations provided by the application.

Say the Excel Jar files with utility methods used the application uses the methods in the Utility Class and the flow is controlled by the way the method gets called in order the get the things done.

whereas

In framework like spring the implementation is defined in XML files and by using annotation and the framework calls the methods as per defined in xml.

Without Ioc

  Application -> Methods -> Framework      

With Ioc

  Framework -> XML File ->  Method Call (or) Implementation      

Inversion of Control(IoC) Container:
Common characteristic of frameworks IOC manages java objects

  1. From instantiation to destruction through its BeanFactory.
  2. Java components that are instantiated by the IoC container are called beans, and the IoC container manages a bean’s scope, lifecycle events, and any AOP features for which it has been configured and coded.

Flow of control is “inverted” by dependency injection because you have effectively delegated dependencies to some external system

The Inversion of Control (IoC) and Dependency Injection (DI) patterns are all about removing dependencies from your code.

For example, say your application has a text editor component and you want to provide spell checking. Your standard code would look something like this:

public class TextEditor
{
    private SpellChecker checker;
    public TextEditor()
    {
        this.checker = new SpellChecker();
    }
}

What we’ve done here is create a dependency between the TextEditor and the SpellChecker. In an IoC scenario we would instead do something like this:

public class TextEditor
{
    private ISpellChecker checker;
    public TextEditor(ISpellChecker checker)
    {
        this.checker = checker;
    }
}

Now, the client creating the TextEditor class has the control over which SpellChecker implementation to use. We’re injecting the TextEditor with the dependency.

Without IoC: you ask for “apple”, and you are always served apple when you ask more.

With IoC:
You can ask for “fruit”. You can get different fruits each time you get served. for example, apple, orange, or water melon.

Inversion of Control, (or IoC), is about getting
freedom (You get married, you lost freedom and you are being controlled. You divorced, you have just implemented Inversion of Control. That’s what we called, “decoupled”. Good computer system discourages some very close relationship.)

flexibility (The kitchen in your office only serves clean tap water, that is your only choice when you want to drink. Your boss implemented Inversion of Control by setting up a new coffee machine. Now you get the flexibility of choosing either tap water or coffee.)

less dependency (Your partner has a job, you don’t have a job, you financially depend on your partner, so you are controlled. You find a job, you have implemented Inversion of Control. Good computer system encourages in-dependency.)

IoC is a generic term meaning rather than having the application call the methods in a framework, the framework calls implementations provided by the application.Inversion of Control (IoC) means any sort of programming style where an overall framework or run-time controlled the program flow.

Dependency Injection is a Type of IoC

IoC means that objects do not create other objects on which they rely to do their work. Instead, they get the objects that they need from an outside service (for example, xml file or single app service).

DI means the IoC principle of getting dependent object is done without using concrete objects but abstractions (interfaces). This makes all components chain testable, cause higher level component doesn’t depend on lower level component, only from interface.

Techniques to implement inversion of control

  1. using a factory pattern
  2. using a service locator pattern
  3. using a dependency injection of any given below type:
    1. a constructor injection
    2. a setter injection
    3. an interface injection

DI is a form of IoC, where implementations are passed into an object through constructors/setters/service look-ups, which the object will ‘depend’ on in order to behave correctly.

IoC without using DI, for example would be the Template pattern because the implementation can only be changed through sub-classing.

DI Frameworks are designed to make use of DI and can define interfaces (or Annotations in Java) to make it easy to pass in implementations.

மகாபாரதம்:
———————

  1. குந்தி தேவி சூரியனை தோத்திரம் செய்து கர்ணனை பெற்றாள்
  2. குந்தி தேவியும், மாத்திரியும் தேவர்களை தோத்திரம் செய்து ஐந்து பிள்ளைகளை பெற்றனர்
  3. திரெளபதிக்கு ஐவரும் புருசர்கள் ஆனார்கள்.
  4. கௌரவர்கள் நூறு பேர். அவர்கள் பிறந்த விதம்.

இவைகள் உலகியல் அறிவுக்கு பொருந்துமா? என்று கேட்டுக் கொள்கிறேன்.

மாகாபாரதம் ஊர் உண்மை ஞான பொருளின் தத்துவ கதையாகும். உண்மையாக நடந்தது அல்ல என்பது ஞானிகளின் கருத்தாகும்.

பஞ்ச பாண்டவர்கள்:
➖➖➖➖➖➖➖➖
தருமா சிந்தனை உள்ளவர்கள் ஐம்பூதத்தால் ஆன மனித தேகத்தின் கண் உள்ள ஐம்புலன்கள் ஞானேந்திரியங்கள் ஆன்ம உணர்வுள்ளவர்கள் பஞ்ச பாண்டவர்களாகும்.

திரெளபதி
➖➖➖➖
மனித தேகத்தை காக்கும் இரத்தமாகிய சக்தி, பெண் அம்சம் (குங்குமம்) என்பதாகும். இச்சக்தியைக் கொண்டு ஐம்புலன்கள் செயல்படுவதால் ஐவருக்கு பத்தினி என்ற தத்துவ கருத்தாகும்.

கண்ணன்:
➖➖➖➖
ஆன்ம அறிவு மாயன், தேர் ஓட்டி, பாண்டவர்களின் மைத்துனன், உலக உயிர்களாகிய தேர்களை வழி நடத்துபவன் என்ற தத்துவமாகும்.

துரியோதனன்:
➖➖➖➖➖
நான், எனது என்ற அகங்கார மமகாரங்களின் உருவம், அஞ்ஞானத்திற்கு அதிபதி. அறிவுக்கும், நீதிக்கும் ஊசிமுனையிடமும் கொடுக்க மறுத்தவன்.

சகுனி:
➖➖➖
கெளரவர்களின் மைத்துனன், தீவினைகளுக்கு வழிகாட்டும் வஞ்சக அமைச்சர்.

கருத்து நம் மானிட தேகத்தின்கண் அறிவுக்கும், அறியாமைக்கும், தர்மத்திற்கும், அதர்மத்திற்கும், நீதிக்கும், அநீதிக்கும், புண்ணியம், பாவம் என்ற எண்ணங்களாகிய இருவினை போர் வீர்களுக்கு இடையில் நாள் தோறும் நடக்கும் மனப்போராட்டமே பாரத போராகும். இப்போர் மானிடன் என்ற ஒருவன் இருக்கும் வரை மனதிற்கும் அறிவிற்கும் ஓயாது நடக்கின்ற போராகும்.

திருநீற்றை ஒரு விரலால் தொட்டு நெற்றியில் பொட்டு போல வைத்துக்கொள்ள கூடாது. அதுபோல தண்ணீர் விட்டு குழைத்தும் பூசக் கூடாது.

நெற்றியில் ஒரு கோடிடுபவர்கள் ஆள்காட்டி விரலுக்கும் பெருவிரலுக்கும் இடையில் எவ்வளவு திருநீறு எடுக்க முடிகிறதோ அவ்வளவு எடுத்து நெற்றியில் கோடிட வேண்டும்.

மூன்று கோடு இடுவதற்கு சுண்டு விரல் தவிர்த்து மீதி நான்கு விரல்களால் திருநீரை எடுத்து, பெருவிரல் இல்லாமல் மீதி மூன்று விரலால் நெற்றி முழுவதும் கோடக அணிந்துக்கொள்ள வேண்டும்.

மேலும் தீட்சை பெற்றவர்கள் மட்டுமே திருநீரை தண்ணீர் சேர்த்து குழைத்து அணியலாம். தீட்சை பெறாதவர்கள் கண்டிப்பாக திருநீரை தண்ணீரில் குழைத்து அணிய கூடாது.

தினமும் திருநீறு அணியும் போது

“நம் தேகமும் ஒருநாள் இந்த பிடி சம்பலாகத்தான் ஆக போகிறது, ஆகவே இந்த உலக வாழ்வில் அதிக ஆசை கொள்ளாது, பொன் பொருள் மீது ஆசை கொள்ளாது, இறை வழிபாட்டில் மனம் ஒன்றி, ஆன்மா வளம் பெற வாழவேண்டும்.”

என்று எண்ணிக்கொள்ள வேண்டும். இதுவே சைவ மதம் போதிக்கும் சிறந்த கோட்பாடாகும்.

சைவ வழிபாடு
சைவ சமயத்தில் கடவுள் வழிபாடும் நன்கு வரையறுக்கப்பட்டுள்ளன.வாழ்ந்தே ஆக வேண்டும் என்ற நியதிக்கு உட்பட்ட நமது விதிகள் மூன்று மூலங்களைக் கொண்டு அமைக்கப்படுவது.

  1. பதி (கடவுள்)
  2. பசு (உயிர்)
  3. பாசம் (பற்று)

இவற்றில் பதிக்கு பாசத்தால் ஆக வேண்டியது ஒன்றும் இல்லை.அதுபோல பாசம் பதியை தொழுது பயன்களை பெற்றுக்கொள்ள முடியாது

இவை இரண்டிற்கும் இடைப்பட்ட பசுவே இவை இரண்டிற்கும் உள்ள தொடர்பு

அதாவது பசுவாகிய உயிர் பாசமாகிய பற்றில் இருந்து விடுபட்டு பதியாகிய கடவுளை(சிவனை) அடைவதே வழிபாட்டின் நோக்கம்

அப்படி உயிர் கடவுளை அடையும் நிலையே “ஞானம்” எனப்படுகிறது

சைவ நெறியின் சிவ வழிபாட்டின் நோக்கம் ஞானத்தை பெறுவதே

“பாசமாம் பற்றறுத்து பாரிக்கும் ஆரியனே” என்ற சிவ புராணத்தின் வரிகள் சிவ வழிபாட்டின் நோக்கத்தை நமக்கு விளக்குகின்றது

எனவே இந்த உலக இன்பதுன்ப உறவுகளில் இருந்து நம்மை விடுவித்து கொண்டு சிவ வழிபாட்டின் மூலம் சிவ கதி அடையவே நாம் முயல வேண்டும்….