The key difference between Library and Framework is in IoC (Inversion of Control)
- by using a feature from a Library you are in control.
- The Framework include some abstract design with built-in behaviors. Control is inverted and the framework calls you; framework code will call the code at those various points that behavior has inserted. The Hollywood principle: Don’t call Us, we’ll call You.
|A certain set of reusable functions of an application (mostly organized into classes)
||As a skeleton of an application
|A collection of class definitions
||A collection of patterns
|You call the library APIs in your code
||A framework calls your code
|The control is always with you
||The control in with the framework if you’re using it
|Libraries meant to do some specific tasks only
||Framework is a predefined design
|You need to scaffold your project manually
||Super easy to scaffold
For instance I have this variable of json expression:
<json expression =”$….Response…..SuccessFlag”>
<var name=”HTTP_RESPONSE” />
to compare it with for an if else condition case, I need to create a boolean variable then put it in the condition; this was really tricky to use, I tried equals, == and some converting ones but this one works like a piece of cake:
a Marker interface doesn’t have any methods or fields declaration (an empty interface) such as “Serializable” or “Cloneable”.
a Functional Interface is an interface with just one abstract method declared in it such as Runnable interface that only has run() method.
An “interface” to iterate through and each and every element of a list (it’s not a class).
||A specific point in the code, every method in every class is a Joinpoint.
||A collection of one or more Joinpoints, for example all the methods of a class.
||The implementation of crosscutting concern, it means what do I want to do with crosscutting concern (Before, Around, After).
||What crosscutting concern do I execute (=Advice) at which location (=Pointcut); in other words what do I want to do, where do I want to do it in the code. –> advice + pointcut
||The advice code together + Target code at corresponding Pointcuts such that we get the correct execution; it means different methods together with right sequence.
And this would be an example how we can write a Pointcut:
This chart* perfectly captures different features of App Servers versus Web Servers:
|What is it?
||A server that exposes business logic to client applications through various protocols including HTTP.
||A server that handles HTTP protocol.
||Application server is used to serve web based applications and enterprise based applications(i.e servlets, jsps and ejbs…). Application servers may contain a web server internally.
||Web server is used to serve web based applications.(i.e servlets and jsps)
||To deliver various applications to another device, it allows everyone in the network to run software off of the same machine.
||Keeping HTML, PHP, ASP, etc files available for the web browsers to view when a user accesses the site on the web, handles HTTP requests from clients.
||distributed transaction and EJB’s
||Servlets and JSP
Question: Apache Tomcat is a Web Server or an Application Server?
Answer: Tomcat is a web server (can handle HTTP requests/responses) and web container (implements Java Servlet API, also called servletcontainer) in one. Some may call it an application server, but it is definitely not an fullfledged Java EE application server (it does not implement the whole Java EE API).**
* source: http://www.diffen.com/difference/Application_Server_vs_Web_Server