Sunday 22 September 2013

Java Spring: An Ultimate framework.



Having Bundles of Frameworks floating around, the first question which arise is "is spring really necessary???"... (Bekitta Iga)... Well, The exact answer depends on the requirements and application complexity. What Spring targets is following features which is an improvement/addition to existing Frameworks.
  1. Unleashing the Power Of Simple POJO-
    • Spring never forces  you to implement a spring specific interface or extend class. At the worst case a class may be annotated with spring annotations.
      Example:

      Without SPRING:
      import javax.ejb.SessionBean;
      import javax.ejb.SessionContext;

      public class HelloWorldBean implements SessionBean{
      public void ejbActivate(){
      }
      public void ejbPassivate(){        ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
      }                                              ;Methods of SessionBean Interface foces you to
      public void ejbRemove(){         ; implement these method which are out of interest
      }
      public void ejbCreate(){
      }
      public void setSessionContext(Session Contextctx){
      }
      public String sayHello(){
      return "HelloWorld";
      }

      }

      With Spring Above code can be simply written,

      public class HelloWorldBean{
      public String sayHello(){
      return "HelloWorld";                 ;;;; Only Business Logic, Rest Is Left To Spring.
      }
      }

      Isn't it Effective???!
 With This Basic and very tiny Info about Spring Framework i'm Logging off today. but with unanswered questions like "How Spring Identifies The Bean?" and "What are The Configuration for setting up spring???" also there are lot more features pending to be discussed, Hope You Like This Post. Will Provide You those in coming posts.

No comments:

Post a Comment