Separating Front-end and Back-end in Codeigniter

Introduction This tutorial will show you an example on how to separate front-end and back-end in Codeigniter 3. Front-end which is mainly used by public users who navigate through the site and sometimes register themselves to get updates on the site activities, new posts, update on a particular post etc. Back-end which is mainly used by site author, administrator, editor…

Using Template in Codeigniter

This tutorial will show you an example on how to use template in Codeigniter. In an web application a template is recommended because there are certain regions or areas which are common to all pages and only the body portion of the page gets changed. Common areas like header, footer, left sidebar or right sidebar are mainly common areas for…

evict() Method in Hibernate

Introduction Here I am going to show you an example on evict() method in Hibernate. The method evict() removes a single object from Session cache in ORM (Object Relationship Mapping) framework Hibernate. So before you call evict() the object should be there in the Session cache. Therefore if you save the object first time, you have to save the object…

State Design Pattern in Java

Introduction State pattern comes under behavior design pattern in JEE. The State design pattern allows an object to alter its behavior when its internal state changes. State pattern is used to provide a systematic and lose-coupled way to achieve this through Context and State implementations. Context is the class that has a state reference to one of the concrete implementations…

Strategy Design Pattern in Java

Introduction The strategy pattern is a behavioral design pattern that enables an algorithm’s behavior to be selected at runtime without causing tight coupling. The strategy pattern defines a family of algorithms, encapsulates each algorithm, and makes algorithms interchangeable. Strategy pattern lets the algorithm vary independently from clients that use it. So you define a strategy wherein a particular algorithm or…

Observer Design Pattern in Java

Observer Pattern is one of the behavioral patterns. Observer design pattern is useful when there is something need to be done with the state of an object and an object wants to get notified whenever there is any change in state. In observer pattern, the object that watches on the state of another object are called Observer and the object…

Memento Design Pattern in Java

Table of Contents Introduction Prerequisites Memento Design Pattern Implementation Main Class Output Source Code Introduction Memento Pattern is one of the behavioral patterns. Memento pattern is a software design pattern that provides the ability to restore state of an object to its previous state. The memento design pattern is implemented with three objects: the originator, a caretaker and a memento….

Mediator Design Pattern in Java

Mediator Pattern is one of the behavioral patterns as it deals with the behavior of the program. Usually a program is made up of a large number of classes. So the logic and computation are distributed among these classes. As more classes are developed in a program, the number of classes are increased, thus arising the problem of communication among…

Iterator Design Pattern in Java

Iterator pattern falls under behavioral design pattern. Iterator pattern is very commonly used design pattern in Java. This pattern is used to iterate through a collection of objects without exposing its underlying representation. It is used to access the elements of an aggregate object sequentially. For example, Java’s collections like ArrayList and HashMap have implemented the iterator pattern.

Command Design Pattern in Java

Command Pattern The command pattern comes under behavioral design pattern. The Command design pattern is used to create objects that represent actions and events in an application. In the command pattern, a command interface declares a method for executing a particular action. A command object encapsulates an action or event and contains all information required to understand the action or…