I primarily come from a PHP background but I have been asked to develop a website using the Java platform. I have been exposed to some terminology that I don’t quite yet understand and I was hoping that anybody with Java familiarity could let me know in basic terms what it means/is used for. Or if you could tell me its equivalency in the PHP world that would be great too. The words are:
- Spring
- Struts
- JavaBeans
- EJB
- JMS
- Servlet
Thanks!
First of all most of them are Technologies that have been wrapped up around Java EE architecture. First of all do you understand what MVC stands for. MVC is Model-View-Controller pattern. It is a design principle that lets you separate your concerns easily. There are couple of PHP frameworks that follow MVC pattern. Eg:- Kohana
Spring
Spring is an MVC aritecture but beware it’s not just for MVC… Spring has loads of uses. If you have used frameworks related to PHP such as Zend or CakePHP you could say that Spring is similar to them. You can checkout the Spring features.
Struts
Struts is a Front End controller. It takes all the requests and map them to their relevant actions. Here is a part from Apache Struts website
Here are the basic components of Struts.
mapped to a standard URI.
which completes the response.
applications with server pages.
PHP equivalent for this should probably be the Routes module in a PHP framework. Some helpful sources to easily get started with Struts –
Struts for dummies
JavaBeans
followed conventions – The class must have a public default
constructor (no-argument). This allows easy instantiation within
editing and activation frameworks.
boolean properties instead of get) and other methods (so-called
accessor methods and mutator methods), following a standard naming
convention. This allows easy automated inspection and updating of
bean state within frameworks, many of which include custom editors
for various types of properties. Setters must receive only one
argument.
frameworks to reliably save, store, and restore the bean’s state in
a fashion independent of the VM and of the platform.
If you found above explanations harder to understand that’s fine since Java Beans can be explained by an example simply.
More helpful sources from – Wikipedia. Probably this is a PHP class.
EJB
EJB – Enterprise Java Beans. This probably doesn’t have a PHP alternative. EJB is bit complex. It’s kinda of like a mega bean that has business logic around it. Best place to find more is Wikipedia –
JMS
JMS stands for Java Messaging Service. JMS provides communication in between Java applications. JMS is a technology and there are many provider implementations of it. Best I heard of happens to be HornetQ. Beware that I haven’t used it. There is no PHP counter part as I know.
Servlet
Servlet is what takes the request and provides controller logic. Servlet routes the files back again to a JSP – which a Java Server page. This can be your PHP frameworks controller code.