| ||
|
This community works best when people use their real names. Please
register for a free account.
Other Groups: Joel on Software Business of Software Design of Software (CLOSED) .NET Questions (CLOSED) TechInterview.org CityDesk FogBugz Fog Creek Copilot The Old Forum Your hosts: Albert D. Kallal Li-Fan Chen Stephen Jones |
I'm a college student who's comfortable with Java. I want to do J2EE web programming with open source tools/frameworks (not WebLogic). I do not have years of experience working with Java as everyone on the Internet seems to. I've seen a lot of people (the famous book authors) complaining about the complaining about the complexity of J2EE and things like EJB in particular - and then advocating for 'lightweight', Inversion of Control-based frameworks like Spring. This is always explained as if the reader of the presentation/text is all-too-familiar with it. Well, I've never used EJB to begin with. Should I learn that if I just want to start out making simple database-backed websites? Will I be missing something in the dependency injection frameworks if I don't? What should I learn in order to call myself an "agile Java web programmer"? How often do you really need XSLT, EJB, SOAP, Java messaging, Java Transactions API, and all the other stuff I see out there? (How do Java people find time to learn this stuff?) I'd prefer to keep things simple: for web services, I'd prefer XML-RPC over SOAP, and REST over XML-RPC. I definitely want to use object-relational mapping tools and do proper model-view-controller websites where presentation, business logic, and database access are kept separate the way I've done in other languages. Is, say, Hibernate, Struts, and Spring sufficient for this? How should I go about evaluating all the competing frameworks? I'd like to hear advice from people who are more experienced. Thanks.
much to learn Monday, December 19, 2005
Advice: Learn the basic J2EE technologies: Servlets, JSP, JDBC. Then move on to a basic templating system - like Velocity. Those are all you need to make a database-driven web site. You might also want to learn about Hibernate. Stay away from EJBs, especially entity beans. They are a total waste of time. (You might also just want to consider learning Ruby.)
Dave Monday, December 19, 2005
I'd give half a point to Dave. Most of these J2EE technologies are used when you have multiple data sources (either databases or entire web sites) and you need to join them together. Its always nice to know the basic concepts, but I think the following... 1) the vast majority of corporate IT jobs will not require them. 2) the few that do, usually have built customized solutions. ...as a result, I would wait before spending a lot of time on specific J2EE technologies. Do what Dave suggested and learn the basics of HTML and CSS, Servlets, JSP, some sort of framework like Struts or Faces and then spend the rest of your effort learning general programming and design principles. As Dave implied (with his Ruby comment) is that there are a lot of tools and even better ones will come along as time goes by. (I really like RoR.) As long as you understand the basic principles, you will be just fine.
Anonymous Coward Monday, December 19, 2005
Err... as a constructive example, I would recommend reading up on design patterns (or the programming oriented books on Joel's reading list) verses mastering SOAP and XSLT.
Anonymous Coward Monday, December 19, 2005
Since you are a college student I would try out every J2EE framework/technology you can get your hands on. Implementating just about anything in J2EE is pretty simple. The complexity with things like EJB's come into play when your are design solutions for the real world. Also try and get a feel for different App Servers/containers if you haven't alreay. You say you are only interested in the open source ones but it is important to be exposed to other ones so you can see the differences between them.
A good understanding of the HTTP protocol, CGI, and basic database design and use (relational design, constraints, SQL, transactions, etc.) will be important no matter what you end up using, so I'd do some research into that. Note: considering the number of caveats with MySQL ( http://sql-info.de/mysql/gotchas.html ) you may want to pick something else lest you get warped for life. You'll need a basic understanding of the Servlet API. Before learning a framework, you might want to implement a simple application (a to do list, or a blog) using JSP, Servlets, and your own object-relational mapping using JDBC. This will teach you why the frameworks are important: no one wants to do all that crap every time they write an application. At the same time, you'll gain some valuable insight into how OO/Relational mapping works and how to implement MVC, without having to edit 15000 lines of XML. For servlet engines, check out Jetty. It's much easier to get going with that than Tomcat. http://jetty.mortbay.org/jetty/ You may want to learn a bit about Ant so you can build WAR files easily. Ant has acquired a reputation for being overly verbose, but I haven't checked out any of its alternatives so I can't speak to that.
One of the things that makes J2EE difficult to learn is that there are about 1000 approaches to any particular problem - or at least it can seem that way to a newcomer. Just look at the number of different web frameworks or persistence frameworks. And it's not just a matter of sticking to the options which Sun supports, as they're often not used in the real world. I agree with others, forget EJB's - can't imagine any new project committing to use EJB's, although I've used them a lot in the past. Start by getting a servlet container like Tomcat (heaps of users, so lots of help available) and learning JSP/Servlets and JDBC. That will at least allow you to write a small web app which talks to a DB. Then, progressively expand into a web framework like Struts or JSF. Next, maybe explore some ORM framework like Hibernate. I think it's important to take it in steps because a) you'll see the importance of actually using a framework as opposed to not using one and b) you'll simply be overwhelmed if you set out to use everything up front and you won't develop a good understanding of any of it. Monday, December 19, 2005
"Should I learn that [EJB] if I just want to start out making simple database-backed websites?" God no! (Oh the humanity!) For a simple db backed website you would want to learn Struts (and the concept of model 2 vs model 1), JSP + JSTL, and a persistence mechanism - Hibernate being the non-EJB one with mindshare these days. (Actually for a simple site JDBC is sufficient so long as you keep it organised). Id leave Velocity for another day. Id reccomend picking up the core part of Spring - the BeanFactory/ApplicationContext IoC stuff. This is useful. The rest of Spring you could leave till later (ie: when you get an itch it scratches). And EJB.... well you do need to learn it for your resume if you ever hope to get a J2EE job - as most HR depts still live under the misconception that EJB==J2EE. (They also think that JavaScript is a lightweight form of Java for web UI work, & hire accordingly, which is why so many UIs are unmaintainable model 1 garbage). Its also worth understanding the basics of EJB just so that you can understand why so many people recommend Spring/Hibernate instead! Oh and a strong undertsanding of threads and multithreading issues is very important if your doing J2EE stuff (especially web tier!) - which is kinda funny as you will almost never actually do anything like new Thread() yourself in J2EE! The container handles it for you - but dont believe the marketroids who say J2EE abstracts it away so much that developers never need to worry about it!
Domainless Monday, December 19, 2005
I pretty much agree with all the advice above. I'd suggest that you: - Learn Servlet API, and JSP. Learn the JSTL and the EL way of doing things in JSP (2.0 and above I think), as opposed to the old ways. You can quickly figure out the old useBean tags should you ever need them. - Do a bit of database code in JDBC. I suggest you learn the basics of Spring, which is especially useful for managing database transactions (be they with JDBC or Hibernate or other). - Use a web framework such as Struts or JSF. My experiences are with JSF and Spring-MVC (I way preferred Spring-MVC). But there are lots out there: you might want to go with what's most likely to help your job prospects as opposed to the "best" (if there is such a thing). - Optionally try out Hibernate. It's very similar to the new EJB 3 (which is a lot more appealing than EJB 2). I find Hibernate really useful, especially when used with Spring. - Only learn EJB 2 if you're really interested or think it'll help you get a job some day. - Learn to use a good logging framework (I'd recommend Log4j over java.util.logging any day). - Learn Ant. It's not perfect, but it's *very* useful. Good luck.
Do you want to build your own stuff or do you want to get a job at BigCorp? Big difference. For learning useful and cool stuff for your own use, see points above. For getting a job at a Fortune 500 - hey, everyone needs bread and butter - yeah, you'll probably have to learn about the different types of EJBs and how they are deployed and used under the different types of application servers - which means WebLogic and Websphere.
+1 for Dave's advice. Stick with the most developer friendly parts of J2EE. Skip EJB, so you don't get turned off Java/J2EE entirely.
Dave is right (EJB's are a complete waste of time). Look at proven technonologies like: - servlets, jsps (maybe struts and tapestry if the come your way) - jndi - jms (the messaging api is actually nice; but again stay away from EJBs). - xml related (that may or may not include webservices). - jdbc, hybernate and such - some lightweight server frameworks, for example spring (although I still hate the idea that people can tell me how to write my own server :) - when you get a bit more advanced, try to scale up/down your application. Try to cluster it to see what the problems are. Also, JINI is an interesting technology. JavaSpaces is interesting too. | |
Powered by FogBugz
