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.
- 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???!
No comments:
Post a Comment