Posts

Showing posts from 2016

JSF Composite Component

Image
JSF Composite Component Since JSF 2.0 , JSF provides a powerful concept of creating custom component using composite component along with JSF facelet tags . A composite component is a special type of component which acts as a reusable component . It helps developer to define a customized component having a particular high level behavior as well as structure along with Labels , attributes , validators , converters and Listeners . User can use that predefined structure and inject their own set of functionality like any other standard reusable components. As per java specification , most commonly used composite tags are listed below : For simplicity, you can think composite:interface as java interface which is used to define a high level abstraction of the entire reusable component . Those configurable values are used in composite:implementation #{cc.attrs.attribute-name} expression to implement those values with reusable standard components . Let’s discuss this tags...

Java Server Faces Lifecycle

Image
Java Server Faces Lifecycle Java Server Faces is a server side MVC based java framework for Web application development. It includes a set of APIs which represent different UI components and helps in managing their states . It helps developers to concentrate on business logic rather than concentrating on common life cycles of Web Applications : Handling requests , Decoding parameters , Validations , conversions , Modification and saving states and rendering responses to the clients . JSF request processing lifecycle starts as soon as new HTTP request is submitted by the client to JSF controller servlet . This life cycle consists of six phases . JSF framework manages life cycle phases automatically . Following are the life cycle phases given in the order of execution  : Restore view Phase Apply request values Phase Process validations phase Update model values phase Invoke application phase Render response phase Generally JSF request processin...

Singleton

Image
                  Singleton is most important and frequently used design pattern in java . It  restricts the instantiation of a class and ensures that only one instance of the class exists in the java virtual machine. To be precise , in a particular jvm there can be only one instance of this kind of class .  This kind of class provides a global access point of the class as it does not allow to create multiple instance of the class . This pattern is useful for logging , driver object , caching , thread pool .             There are different approaches to implement singleton classes . But all of those approaches consist of following rules in common :  Private constructor to restrict instantiation of the class from other classes. Private static variable of the same class that is the only instance of the class. The global access point to instantiate the class is a public static...