3 ms·
Let's take a look at it from a different angle. Say, I have a group of developers who have been trained to use Java (both best-practices, idioms, tools, etc).
by edwinnathaniel 14y ago
Let's take a look at it from a different angle.
Say, I have a group of developers who have been trained to use Java (both best-practices, idioms, tools, etc).
Let's say that JEE 6 shows up (no, I don't remember JEE 2.1, what is that? is that thing even exist?).
JEE 5/6 introduces a few things on top of my head (please pardon me of the syntaxes):
1) Dependency Injection via annotation (CDI in JEE6, EntityManager in JEE5)
Introduction: annotate the instance property you'd like to inject and GlassFish will magically give the class to you.
Example:
@Inject
AccountService accountService;
2) JAX-RS
Introduction: A class, that works like servlet, but without doGet() or doPost(), instead you have methods that maps to the request-path based on the annotation.
Example:
@Path("/account/{id}")
public Account get(@PathParam("id") final long id)
3) Transaction (in EJB3 which appears in JEE5)
Introduction: Sprinkle annotation in your class or method, you get transaction magically.
Example:
@TransactionAttribute(REQUIRED)
public class AccountRepository
or
@TransactionAttribute(REQUIRED)
public Account updateAccount(final Account toUpdate) {...}
So I'm not sure how complex all of these to grok, granted if you need to do something out of the ballpark, you may have to learn a bit more of each individual component but to get started and be productive seems quite easy for me.
Now let's compare that with picking up Scala from zero (given that you know Java already) and get comfortable and productive with Scala, its tools, and its libraries to build web-application with the similar setting of that in JEE (web-service, REST, persistence/db/orm/transaction layer, unit-test, integration-test, etc).
No cheating though: no calling/utilizing JEE. Has to use all-things Scala libraries.
- pkolaczk 14y ago"So I'm not sure how complex all of these to grok, granted if you need to do something out of the ballpark, you may have to learn a bit more of each individual component but to get started and be productive seems quite easy for me." It is so easy only if you don't try to write some serious production level stuff using it. You must be insane to start a project in JEE knowing only some basic tutorials and without deep understanding how the full stack works. I worked for a company that do JEE trainings. It was near impossible to teach a team using full JEE stack in 5 days (7 hour / day) - no, actually each single component is like 1-2 days of training, given that everything is preconfigured and ready to go. And after training they usually ask for consulting, because they still have some technical problems with it. This is similar to Scala. You have to probably have someone on the team with deep understanding, but most of the coders just need to know how to do basic things in it. We used Scala for a project in the company, and the only concern then was poor tooling (that was 2 years ago - it is much much better now), not the language itself. Most programmers just jumped right into it as a Java with slightly simplified syntax - "oh, I don't need to know when to use Integer and int, cool!". // Errata: I meant EJB 2.1, not JEE 2.1, sorry for the mistake.
- edwinnathaniel 14y agoActually... I've had previous positive experience dealing with some parts of JEE and some parts of Spring from almost zero (just knowledge on Servlet and JSP) to production level (JAX-RS, JAX-WS, JPA/Spring-Data/Spring-Transaction, Spring-Portlet-MVC, Spring-Core). They just seem to ... "work out of the box". Had two production issues in a year and they are all JPA. From all of the modules, JPA seems to be the more complex piece of the puzzle with EJB/JMS probably trailing. (Granted we did not have to use JMS yet). While I do understand your side of the story (you may be aiming for JEE full-stack from JSP, JSF, Servlet, JPA, EJB and tons of its quirk, JMS, transaction, etc), if you focus to the essential: JEE 6 web-profile, it is much easier compare to starting with Scala from zero to knowing best-practices and idioms of the language.
- pkolaczk 14y agoAgreed, but before JEE 6 web profile, essentially all before JEE 5 was much much harder to work with. Deploying a basic demo EJB 2 app on some ancient JBoss took our team of "enterprise developers" about two weeks. I'm just saying Scala is nothing exceptionally more complex than many other things that are or were used by so called "enterprise developers". BTW: on the last training in databases I led we used Scala as a language in which some sample programs were created. The group was not specifically prepared for that. Actually they were even not all Java developers. They had no problems in understanding Scala code and modifying it for the purpose of the excercises.