Strategy Pattern

This pattern is listed in Behavioral pattern which allows you to define sets of algorithms in the parent class which will be extended by sub classes in which all the given algorithms are interchangeable. The best way to observe this pattern is to study the below example. public abstract class Employee { public abstract int

Passing objects between managed beans&controllers

in the source controller add your object into faces session map interface and identify it with a name FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put("category", category); then in the target controller to acquire the object do the following Category category = (Category) FacesContext.getCurrentInstance().getExternalContext().getSessionMap().get("category");

Java Lambda Expressions Collections Example

I was wondering new features in Java 8 and wanted to play around with Lambda expressions. So I’ve eventually ended up preparing some collection examples. Hope you’ll easily summarize and understand it The Code package; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.function.Predicate; public class CollectionExample { public static void main(String[] args) { List<Developers>

Interfaces Versus Abstract Classes

While you use an interface to specify the form that something must have, it does not actually provide the implementation for it. In this sense, an interface is a like an abstract class. The abstract class must be extended in exactly the manner that its abstract methods specify. An interface differs from an abstract class

Getting current server name

// BO necessary util classes and defining instances for each class IInfoStore boInfoStore = null; IInfoStore boInfoStore2 = null; IInfoObject boIInfoObject = null; IInfoObject boIInfoObject2 = null; IInfoObjects boInfoObjects = null; IInfoObjects boInfoObjects2 = null; SDKException sdkException = null; IEnterpriseSession boEnterpriseSession = null; IPluginMgr boPluginMgr; IPluginInfo boPluginInfo; IUser boCurUser = null; IUserGroup boGroup = null;