Java EE Microprofile - java

I know it could be a pretty vague topic but please can someone explain it in plain English. I've read some articles regarding the trending topic java EE's 'microprofile' but was not able to clearly understand its purpose.
My understanding in this emerging concept is that java community finds way to reshape the Java EE model to become a microservices friendly framework or platform.
If we can already create a distributed microservice application in few minutes using spring boot or other API / library then why do we need microprofile?

I am active within the MicroProfile community on a daily basis (and primary author of the FAQ on MicroProfile.io). As Gimby mentions, check out the FAQ.
Basically, the JCP is a standards organization and doing innovation using a process designed for standardizing technology is a no-no. The idea of MicroProfile is to do rapid innovation with Enterprise Java and Microservices that leads to technology standardization. To James' point, yes, it is getting off the ground using Java EE technologies so it will feel more natural for Java EE developers.
Going forward, however, MicroProfile will not be limited to Java EE technologies. It may adopt other non-Java EE frameworks or even create new APIs. Once features/technologies are mature enough, we'll look to standardize them. If you like the idea of standards around Java microservices and want to participate in innovating-before-standardizing, then join the MicroProfile google group and feel free to get involved in doing so. You can have direct input and even contribute code that will eventually be part of a standard.
Hope this helps.

If you like Spring Boot then I'd stick with it really. One of the whole points of microservices is for teams to use the technology that suits their needs and that they are happy with.
IMHO the Java EE Microprofile is focussed on helping help folks who know or like Java EE to move to microservices reusing their Java EE knowledge; rather than having to relearn how to do things on Spring Boot. e.g. so they can reuse CDI if they prefer that to Spring DI

Related

Should I go for Spring or stick with Java EE 6? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I will be finishing the core Java course and now I have to move on to Java EE side.
I am so much confused that I should simply go with Java EE 6 because I have the books which easily teach from start to end and everything is there.
Or should I start with Spring only?
Because as I have to start from scratch it is good I follow the trend which is good and more job oriented.
Or even if I do Java EE only and then if I need to move on to Spring it will be fast or vice versa.
Also where does Hibernate stand between them? I mean if I use Java EE 6, do I still need Hibernate or in Java EE 6, I don't need it.
Will I be at a disadvantage if I don't use Spring or Spring can make my building web application any way easier than the core Java EE/ JSF framework.
Though your question suggests that Spring and Java EE are two different things, in reality they are not. You can use many Java EE components like
servlets and JSP for Spring MVC,
JPA for Spring DAO.
JTA for Spring security
The only major thing Spring replaces in the Java EE stack is the EJB. Unless you insist on using EJBs, Spring should be the way to go. Also Spring provides inbuilt support for webservices and other things as well.
Also checkout the Groovy and Grails that use Spring as the base.
Finally I would say, functionality wise both does the same. It's code (Java EE) vs configuration (Spring), a matter of preference really.
All my comments should be taken with a grain of salt. I've been a Spring user since version 1.0; I've never used any version of EJB in production - from 1.0 to the present.
Spring has served me well: any technique that I would want to apply from Java EE is available to me in Spring. I've used the web services, LDAP, messaging, and portlet modules along with the usual suspects from persistence, remoting, and web MVC. The code is excellent. I find that emphasis on layering, coding to interfaces, dependency injection and aspect-oriented programming benefits my designs.
The truth is that you can choose either and make it work. There's little advantage or disadvantage at this point, because EJB 3 took so much from Spring that they're supposed to be similar. I can't say that from personal experience, because I haven't used EJB 3.
None of my employers or clients are clamoring for EJB 3. People in my market are using Spring or .NET to talk to web services over HTTP.
EJBs require that you use RMI or CORBA as your network protocol. I believe that HTTP based protocols - be it RPC-XML, SOAP, or REST - are winning, because simple and open usually does.
No one can foretell the future, so job prospect advice is worthless. Your local market conditions might not be the same as mine. You can hedge your bets and learn both. Whichever you choose, it's almost certain that you'll have to learn something new in the future that won't be either EJB or Spring. So pick one and be ready to change.
From my personal experience from learning Java EE/Web programming from the just standard Java, I tried to jump right into some of the frameworks without a clear understanding of how the Java EE/Web stuff worked. While not all of Java EE is relevant if you are using a framework like Spring, I think it is a good idea to have a good grasp of some of the underlying technologies. You don't have to go overboard, but understanding some of the basics is a good idea.
When something is not configured correctly in the libraries (like Spring) sometimes they assume a certain level of knowledge on their user's part. After struggling with a few basic issues, I spent some time and went back to the basics. After that I was better able to deal with the frameworks.
I would just forgo the EJB route though.
First please understand that Java EE is not a single specification, but a set of specifications. While Spring is a framework.
Spring has a neat integration with many Java EE specifications including EJBs.
The idea of using the specifications is to make your application portable between different implementations of this specification. Unfortunately this doesn't work very well in real life.
Now regarding Hibernate. Again: it's a framework. Java EE includes a specification called JPA. Hibernate implements JPA. You may find other implementations. So if you are using another implementation, you don't need Hibernate.
Now, you are probably want to know the bottom line. I don't really have it. If you are studying Java, the more you know, the better it will be.
If you are looking for technologies to start a new web application, I believe it's better to use Spring with a servlet container (servlet container is part of Java EE!) like Jetty or Tomcat + to use JPA (Hibernate implementation) for persistency.
Spring and Java EE 6 is in some sense similiar. They goes their way in parallel. I think it will be better if you learn Java EE 6 and then (if want/need) learn Spring.
In Java EE there is Java persistence that works very well for different database query purposes.
There is really no reason to go with Spring on a new project. There are a lot of applications out there that still use it though. You should definitely learn Java EE before Spring. Spring used to make development easier. At this point though Java EE is easier to work with and you can get rid of the Spring dependency as well.

WHich is the best path or flow to learn java from web site perspective

I have just started learning java and i have about 8 months time. My main aim is to build web application using java. But as there are many java technologies/frameworks available i am conufused how should i go
IDE i am using is eclipse
The path which i am thinking is below
1)Learn Core Java
2)Project: Build Java Invoicing System with JDBC or mysql to test java knowledge
3)Learn Servlets / JSP to
4)Build small site like simple logon/memberarea/catalogue using servlets/jsp
Now guys I really don't know where the following things stand in my path and which things they will help
1)Java EE
2)Spring or spring MVC, what's the difference?
3)Hibernate
4)Wicket
5)Struts
I really don't know how should i learn those and which things to choose from.
what should be my final project which can be build using those because if i see from my current stage even website can be build using servlets/jsp. then why do i need those other technologies
Can anyone give an example of a project which can be build using new technologies and not using jsp/servlet, so that I can get an idea why we need those?
Lot's of stuff to learn in here so I would take it a bit at a time. I'm going to assume you are relatively comfortable with the Java language and core APIs.
First learn about JDBC and databases. Get a basic functional JDBC example app working (not visual just some a vanilla Java app) that does read/insert/update/delete of some records in a table. This will give you the basis for building whatever app you choose. Almost all interesting applications involve some sort of persistence/database.
Learn the main JDBC APIs (Connection, PreparedStatement, ResultSet) and write some code that uses these to get comfortable.
Learn about how transactions work in databases if you aren't familiar already and how JDBC uses them (Connection.commit and rollback)
Next you could look into the spring framework. This has a several useful features that come in handy when building these applications. The main ones to get to know the dependency injection functionality and the JDBC libraries it has. The DI stuff is a bit of a "duh"? if you haven't used it before but it is very useful/powerful especially for medium size + apps. The JDBC libraries help with the cruft of dealing with the raw JDBC APIs and make your code less error-prone.
Once you've got some basic JDBC and Spring stuff worked out you can then start bringing in a web framework.
This is more difficult because there are so many. In the interest of getting something up and running quickly I would probably go with Wicket. It runs inside a servlet container like Jetty, easy to get up and running with a basic web page or two and relatively easy to evolve of the project over time without going down too many blind alleys. I've found that frameworks like JSF (the Java EE default web/view framework) takes a lot of up front time investment to get going on. Most of these frameworks, including Wicket, can leverage the spring stuff you've got above.
Avoid JSP, it's unpleasent technology and outdated by virtually everything else.
To answer some of your other points.
Hibernate is a tool for mapping an object model to a relational model. In it's most basic form you define a Java class for each DB table with the class having one Java property (variable+getter+setter) for each DB column. You can also add references from one class to another to model database relations. It is good but it takes a bit of getting used to.
Spring I've explained partly above. Spring is much bigger than just DI and some JDBC libraries. It also has transaction management libs and bunch of other stuff. Spring MVC is a web framework which lives under the spring umbrella and makes use of a lot of the spring libraries internally. I've never used it so can't offer an opinion on it.
Java EE is an umbrella term for a large set of "enterprise" specifications/libraries. JSF is a web view framework that is part of Java EE.
That's my very high level advice. To summarise I would learn basic DB/JDBC then some spring stuff and then start building a basic web app using what you've learned already.
Hope that helps. There's plenty of info out there on the web on all these topics and you can always ask questions here on more specific parts if you need help. Good luck and enjoy!
EDIT (to address comment):
All of the above is my recommendation/opinion on how to approach learning Java web development.
In summary
Learning JDBC/transactions/databases is a must
Spring is optional but I strongly recommend. Spring is a big library but you can pick and choose the bits you like/need.
Web frameworks the choice is really yours. From what I have tried (JSF/JSP/Wicket) Wicket is the easiest to get going with so you don't spend too much time frustrated with the getting the initial setup. JSP is awful, it's very easy to make a mess with it. JSF is powerful but heavy and probably more suited to very enterprisy projects than a first web app.
Hibernate is optional but can make life easier simply because you can work with Java objects when you do DB queries/updates rather than writing tedious insert/update statements. Hibernate isn't the only tool like this but it's the one I've used most and does the job well. Just don't go too overboard with the "clever" hibernate features initially.
You could easily use Spring MVC instead of Wicket. That may be a perfectly good choice, I've not used Spring MVC myself so can't comment. I'm sure it will integrate well with spring stuff tho so that would certainly be a positive factor.
Do some more research if you're not sure, there's no end of people happy to give their opinion! But really you just have to dive in and try something.
You are correct. If all your applications are served by servlets, JSPs, and JDBC, then maybe you don't need to learn anything else.
I commend you for learning the fundamentals first before diving into a thicket of frameworks that you don't understand. That's a good thing.
But if you reach the point where you have those down cold, maybe looking at these other technologies can help you improve your game.
1)Java EE
You are learning (part) of Java EE when you use servlets, JSPs, and JDBC. They're a subset of the full Java EE machinery - EJBs, JMS, JNDI, etc.
2)Spring or spring MVC whats
difference
Spring is an alternative framework developed by Rod Johnson and Springsource, now part of VMWare, that is based on dependency injection, aspect-oriented programming, and framework modules. Spring web MVC is one module in the Spring framework, based on servlets, that acts as the front end for web applications.
3)Hibernate
An object-relational mapping technology (ORM), built on top of SQL and JDBC, that lets you map objects to tables. It has its own object-based query language.
4)Wicket
Another web MVC alternative to Spring MVC, Struts, JSF, etc.
5)Struts
The first web MVC framework. It's gone through versions 1.0 and 2.0, and has now been supplated by Java Server Faces. It's still used, though. Like all other web MVC frameworks in Java, it's based on servlets and JSPs.
From a Java perspective it might be best to start looking at Java EE. All the others you mentioned are alternative technologies, which might be useful to you if you decide that what the standard framework offers isn't your cup of tea. But for that to decide, it's never a bad idea to at least know what the standard framework is about.
Truth be told, before 2006 the standard framework had a bad reputation and some of the sentiments that form the basis for recommending alternative technologies are still based on that. Starting with version 5, Java EE got dramatically better. The latest version, Java EE 6 is arguably one of the best Java frameworks that's out there. Of course, the best is a highly subjective term and naturally it won't be the best one for each and every person out there.
At any length, Java EE 6 is a very complete framework that allows a large range of application to be written without depending on any additional library. Being the standard framework, most other frameworks at least depend on some parts of it.
Most typically EJB, CDI and JSF are replaced by alternative technologies. E.g. the core Spring container replaces EJB and CDI and Spring MVC replaces JSF. A full Spring stack typically still uses JPA, JTA, JMS and Servlet from Java EE. Wicket on its turn only replaces JSF, or when used with a Spring stack replaces Spring MVC.
Hibernate is a special case. It doesn't replace anything from Java EE, but is instead often used as an implementation for one of the key APIs of Java EE: JPA. The original creator of Hibernate, Gavin King, is one of the prime supporters of the Java EE framework and is in fact the spec lead of one of the most important parts of modern Java EE: CDI.
Wicket by itself is a very nice web framework, but in practice it isn't used as often as JSF. I won't go into the discussion whether Wicket or JSF is 'better' (this is mostly a religious battle anyway), but due to the popularity of JSF there are simply more people experienced with it and there is a large community offering many things for JSF like component libraries and extensions.
Struts has historically been completely replaced by JSF. The original creator or Struts, Craig Mcclanahan, was the one who started JSF as the successor of Struts. Nevertheless, Struts was once the absolute de-facto standard for web frameworks in Java. It's not often advised to be used for new projects, but till this day it's still used in a huge number of existing applications. So even though it's not really 'hot' to learn Struts anno 2011 knowledge of it may still be very practical for when you have to maintain existing applications.
ps
See this answer for a general description about Java EE: Frameworks for Layering reusable Architectures
I'm sure that nobody seriously can tell you the best way, because this would mean that (s)he would have tried all. Why do you want to learn a Java web application framework? Just to learn it to be prepared for the (next) job? In that case it is likely that you've learned the wrong one.
The next question would be what you want to do with the web application framework. Do you want to make a website a little bit active, e.g. make each page look similar (corporate design), auto-generate menus from an internal structure, or do you want to write a real web application, e.g. with database access.
I'd first define the goal what you want to achieve. IMHO a good way to motivate you to make it right is to take a small project which helps you to solve a small problem.
Then I would start with Java Server Pages (JSP) and servlets to understand the basic concepts. Then you can try to do the same with a few well-known web application frameworks, e.g. Wicket.

Route to study Java EE and associated technology?

I am an undergraduate student with knowledge of core Java. I want to learn Java EE and related technology for my final year major project and career prospect. what are the Prerequisites for Java EE?
I and my friend have done some research on this matter. We found that we need to know about Servlets, JSP, Javabeans, RMI, etc. We have basic knowledge about these topics. Can we start learning Java EE?
We also found that using framework like Struts or Spring etc will have additional advantage to our software. As per my opinion I should use lightweight framework instead of enterprise framework like spring. can we use these framework in small projects? If no, then what is a better approach/framework?
Our project is a collaboration software for managing code development for open source software development.Project is of Distributed nature.
what are the Prerequisites for java EE??
Strong knowledge of Java SE, especially JDBC. Good object-oriented design and programming skills.
can we start learning java ee ?
Of course.
As per my opinion i should use
lightweight framework instead of
ENTERPRISE framework like spring.
I don't know what "lightweight" means to you, but Spring was created as a lightweight alternative to EJB 2.0. You can certainly start learning Spring, but perhaps you'll appreciate it more after you've done at least one web project without it.
I don't recommend Struts. I think it's an older technology - the first web MVC framework - that's been bypassed by others. I'd recommend Spring MVC or Wicket over Struts. If you want to stick with the Java EE standard, try Java Server Faces.
can we use these framework in small projects?
You can use Spring in any sized project. You don't even have to write the entire project using Spring to gain advantage from it.
if no then what is a better
approach/framework?
Start without any framework. Servlets, JSPs using JSTL (no scriptlets) and JDBC are sufficient to start.
our project is a collaboration
software for managing code development
for open source software
development.Project is of Distributed
nature.
Collaboration and management of projects have nothing at all to do with your choice of language or framework.
Is the application distributed, the developers, or both? Choice of language or framework have almost nothing to do with it.
Yes. The official Oracle tutorial is at http://download.oracle.com/javaee/6/tutorial/doc/
I would suggest that you initially keep it as simple as you can. Java EE is big enough that doing a project just with core technologies will keep you quite busy.
I would suggest you learn Ruby + RubyOnRails. It's far more easier and productive than any Java framework you can get. The advantage of this approach would be: you'll have one more powerful mainstream language in your arsenal, and you'd also learn a very powerful web framework which is considered a state-of-the-art framework in the web world.
If you are interested in following this approach, retag your question with ruby-on-rails to receive valuable inputs from other Rubyists.
Hope that helps,
Aai Zhavli.

study roadmap for newcomer into java ee

I'm the newcomer into java ee,I have studied about core java,servlet,jsp.
Could anyone give me some suggestion(some books,forums,etc) on how to promote my skills into java ee?
Thanks a lot in advance.
One good place to start is Sun's Java 6 EE Tutorial on the Sun web site.
I would recommend Server-Based Java Programming. This isn't a Java EE book per se, but it explains what a Java based server needs to do and how to do it with good example code. It will give you the foundation to understand to understand what Java EE is trying to accomplish and why things are the way they are.
In the same vein, I would recommend Expert One-on-One J2EE Development without EJB. This book is written by the founder of the Spring project and provides insight to the problems with Java EE that Spring is trying to solve. Note this was written before Spring was open sourced, so it's more a 'this is how a server framework that's not Java EE could work' book, not a 'how to use Spring' book. Even if you are using straight Java EE, it helps to know what issues you could run into (with J2EE) or what the motivations were for Java EE 5 (based on Spring & Hibernate philosophies).
I would not recommend the actual specifications from Sun. They are dense, technical and better used as a reference.
To be an effective J2EE developer, you'll have to have a few frameworks under your belt. Start boning up on Spring, JSF, Hibernate, etc.
For more details, see my answer to this question.
Spring is an excellent first choice of framework, for reasons that may not become apparent until you've used it on a large project. But the best tutorial I know for learning it is Manning's Spring In Action.

Java EE Programming Skills

I have many years of experience in Java including Swing, Servlet and JDBC, but have never programmed for a Java EE server.
Many job advertisements from large companies are specifically asking for Java EE experience. Are there specific skills or development environments that I should learn to qualify for these kinds of jobs?
Download JBoss and get to work on the sample applications in the documentation. If you've done java, you're 95% there. Java EE adds the container and naming aspect to the java you already know and love. With the advent of EJB3, beans got a lot simpler as you only need a couple of annotations to get rolling with EJB. Java EE can be a bit daunting with the acronym soup of technologies available, but concentrate on the basics: EJB3, JNDI, JMS, data access (like Hibernate/JDO), and container basics.
"Are there specific skills or development environments that I should learn to qualify for these kinds of jobs?"
If I were to interview someone for a typical Java EE shop, I would like to know how well you know the following
1) servlets
2) EJB (maybe)
3) JSP
4) ant
5) junit
6) subversion or other VCS
7) http and html
8) javascript
9) struts
10) hibernate
11) spring(maybe)
I'm not trying to scare you BUT 1/2 of what you need to know you can get by the "PROFESSIONAL J2EE" from WROX press. Rest of the skill, you should be able to get by with a spring book(most spring books also talk about stuts and hibernate) -- for example "The Spring Primer" -- http://www.sourcebeat.com/books/springlive.html.
Good Luck
Those jobs are most likely asking that you have experience with one or more of the major app server vendors, i.e. WebLogic, WebSphere, or JBoss. It's a bit different from what you're used to with servlets & JDBC, but it's still just Java. Typically you have to deal with things like JNDI lookups, dependency injection, messaging queues, maintaining application state between transactions, object/relational mapping, etc.
I have found that for most Java EE projects, it's more about knowing how components and systems are configured and how they work together than it is about any specific programming skill. And you also spend a lot more time waiting for the server to start up ;);
get the book "Professional J2EE" from WROX press -- it is 6-7 years old BUT the content is pretty good. You should be able to get by just fine with that book and a 3.x version of JBoss or a 4.x version of JBoss and eclipse.
Whenever you do start interviewing, Ken, be aware that the nutty Java marketing machine seems to be renaming J2EE to Java EE. You could conceivably run across an HR department in the near future that has never heard of J2EE, but desperately needs Java EE experience.
I think you're in good shape. Servlets are part of Java EE so you already have one skill. JDBC are used as well pretty much the same, but most of the time under some other frameworks.
So I would say you already have ( some ) Java EE experience. Read about EJBs, Transactions, and I think you're ready for an interview.
A lot of times the only way to get that experience is getting hands on. If you convince your interviewer that the skill you have already are enough as to get the position, you'll get the rest by experience.
Go on! You're ready. ( if not at least you'll learn from the interview :P )

Categories