Domain: opensymphony.com
Stories and comments across the archive that link to opensymphony.com.
Comments · 14
-
My recommendations
www.springframework.org is a must - there is over a year's worth of learning in this suite of libraries. This, more than any library affects good coding practices. It's an outright replacement for EJB. It successfully implements AOP but few of the negatives. You just get more work done while simultaneously future-proofing your code.
jakarta.apache.org - there's a year's worth of learning in these libraries. commons-logging, commons-beanutils, commons-digester, commons-codec, commons-dbcp are just a few of the invaluable libraries.
hibernate.org - This will take a long time to MASTER. There are tons of bugs and use-cases that it just handles poorly. But this plus a mix of either raw JDBC (which I don't recommend) or spring's JdbcTemplate provide for a very elegent combination of DB accessibility. The biggest advantage of hibernate, in my opinion is that you can break the problem down into a series of layers, and work on each layer independently. Caching, delete-cascades, object-oriented design, filtering, event-processing, message-pasing, static-queries and OOP-queries.
http://www.opensymphony.com/quartz/ - I'm not crazy about quartz - it doesn't do things the way I'd like. But it's one of the better scheduling systems for Java enterprise.
tomcat and or jboss and or glassfish are a must. You're not very useful without a FULL understanding of how to setup (and this means clustering, fail-over, session-replication, session-server-pinning, apache-front-ending (to support server-pinning and static-file off-loading)). Learning mod_jk (which I hate in many-to-many server-to-application configurations) AND Apache 2.2's mod_proxy_http (which I love). Learn everything there is to know about deployment. How files get stale.. Where different log files end up. How to configure logging on the fly.
Learn Java's JMX, to better understand how to work with long-running java processes. Jboss makes it easy, and tomcat makes it available.
Learn Eclipse or other major editors (can't vouch for netbeans but I hear a lot of good things). IntelliJ's IDEA is a great (but expensive) commercial editor. This is what really differentiates Java from other languages. There is almost nothing in the language that can't be analyzed by the editor. Since Java is strict (except for reflection), it is very safe to do multi-thousand-file variable/method/class renames, safe-deletes, etc. With annotations, most of the meta-programming has started going away - meaning some things we use to treat reflectively directly in code are now handled by 3'rd party tool-kits which have you place annotations in your code to mean special code-flows. The advantage is that if your editor is aware of those 3'rd party tool-kits, then it too can analyze your code for those annotations.. Hibernate 3.3 is a great example. My editor checks DB column names, types, constraints in real-time based on the annotations. It can investigate the HQL (Hibernate Query Language) and spell-check column names - purely based on these higher-level annotations. All you need is an active community to keep such 'magic coding syle's well understood by the popular editors.
Definitely learn DB transactions inside and out.. Learn how to avoid race-conditions. How to avoid dead-locks. How to perform optimistic locking, how and why that's different from pessimistic locking (this isn't a java thing, it's an enterprise DB thing). This does require postgres or INNODB in mysql instead of MyISAM, however. Learn how to write code which has as few inter-dependencies as possible, to support high volume concurrent programming.
Learn to program with as little static (global) variables as possible. Learn how mentally identify regular non-static fields as globals. Namely if two threads can see the same field, it's a global - plain and simple. Learn how to code to MINIMIZE synchronization constructions - this minimizes dead-locks, and speeds up code. Note a dead-lock is a bug in you're code; just
-
Grails or Webwork
-
Re:Crystal Ball time...b) Open source software written in Java that already exists will get a boost in interest and visibility, as it is no longer using a language that is non-free.
I don't see this making a big difference. Most of the open-source Java software I've seen is aimed at accomplishing a particular task in Java, so the people who would consider using it have already bought in to Java itself. I'm thinking mostly of web development frameworks like Hibernate, Struts, and Webwork. The people using them have already made the decision to do server-side Java; the fact that it's now open-source is nice but not really that big a deal. Maybe I'm biased because I mostly do server-side Java development, and everyone I know who writes that sort of software already uses plenty of open-source libraries.
-
Re:missing
Sorry, I always manage to fuck up the name: it's WebWork (singular), not WebWorks (plural).
-
Re:Help me out here
The fact that you are talking about JSP shows how little most people know about Java. MVC frameworks like Struts, Spring, Webwork, etc. have been around for a long time. While PHP seems like a great tool for creating (simpler) websites, no one can deny the maturity and vast amount of libraries that Java has to offer. This is definitely apples to oranges.
-
Options
-
Caching strategyHaving read TFA I noticed (if I read it right anyway) that the two caching strategies of each stack were very, very different.
RoR was taking the entire page output of a new request, caching it, and then sending that entire result for subsequent, similar requests.
The Java stack, OTOH, was using some fairly complex middle and data tier caching inside Spring and Hibernate.
These are VERY different caching strategies. I'd be interested to see the results if the author had used something like OsCache on the Java stack.
My company powered the site for a very large UK awards show, and used OsCache heavily; the results were fairly impressive, allowing us to soak almost half of the server's 100Mbit network pipe at peak traffic without putting a great deal of load on the server (I think top was showing around 0.5/0.6 at peak load, although I realise that this is not a good indicator of load).
-
Re:Making fun of php?
"It's just absurd. They really don't take into account the target marked for the solution. And the current system setup is running just fine and dandy without any trouble. Should the number of visitors increase ten-fold (which it never will), well... Add some slave database servers and more webservers. Suddenly you have the board of directors going: -Uhm, why didn't you write the system in Java. We hear Java is a good thing. Java is scalable. Java is more secure."
I've encountered this a few times myself but I have a different view point on it. I agree that many sites will never grow enough to worry about scalability but the one thing that does almost always happen is new features being added.
I've personally seen a few PHP sites that run flawlessly but they are not easily extendable. They are written in such a manner that developers are afraid to work with it because it's too easy to break stuff, or adding new features will involve rewriting big chunks of code. I will admit that I've seen this in other programming languages as well such as
.asp and .jsp/java.If you consider programming styles such as struts, cocoon, webwork, etc. which encourage the MVC pattern it makes huge difference in the maintainability of web applications down the road. I find that java applications tend to use either these types of frameworks or custom ones that follow the same idea while I find many PHP applications are more like spaghetti code that do work fine but are a nightmare to add to in the future. They are quickly built but the lumping of PHP code in HTML makes it hard on projects where designers need to update the look and feel of a website but have no idea how to change their pages without mucking up the code.
I'm not saying that is the case all the time but what I am noticing is that PHP is gravitating towards OO programming and seems to be encouraging the separation of business logic from presentation logic, which is a very good thing. The argument that PHP is not as scalable as Java really should be more like PHP is not as extensable or maintainable as Java, but this certainly seems to be changing for the better.
-
So why is there so much Open Source Java stuff?
ESR, once more, is publicity-whoring on a subject he either knows nothing about, or chooses to be deliberately ignorant of. Any brief perusal of the Java scene will uncover an enormous amount of Open Source work going on, some of it very high quality. (And much less so, of course, but that's the same all over).
What ESR really means is that there's a lack of adoption of Java from Unix/C programmers. This has nothing whatsoever to do with whether Java is Open Source or not, and everything to do with the perception amongst such programmers (whether deserved or not), of the Java language itself. People don't choose Perl, Python or Ruby over Java because the former are open source. People choose them because they prefer using the scripting languages.
I have this feeling that Scott McNealy isn't sitting there thinking "Damn, I guess if we totally cede control over this language, all those Unix nerds who hate Java anyway are going to drop their copies of Python and come rushing to embrace us!"
Charles Miller -
Re:Au Contraire...
Perl development is so much quicker than JSP servlet development partially because there are so many well-written and thoroughly debugged CPAN modules written for Perl
Not to burst your bubble, but there's oodles of "well-written and thoroughly debugged" code available for Java (JSP/Servlet) programmers as well. Check out OpenSymphony, the Jakarta Project, etc.
(and partially because Perl is simply so much quicker for development!-P)
I'd say that's a debatable point. :-) -
Re:What is it ?Struts is a web application development framework (WADF), of which there are many. The proliferation of open source WADF's prompted Anthony Eden to begin his Wafer Project, which aims to compare
the many open source web application frameworks which are available using a common example application. This research project is designed to compare the application frameworks on a level field by specifying an example application so that the application features become irrelevent and the merits of each framework becomes the focus.
Anthony could probably use some help.You can find many links related to Struts on Ted Husted's page, because he's the lead developer for Struts and the author of the O'Reilly thereon.
In the opinion of some of the smarter Java developers, Struts is no longer the best of the WADF's in the Java world. Some of them seem to prefer WebWork, which is now part of OpenSymphony. Debate over Struts is raging.
Check out an attempted improvement to Struts.
-
Re:What is it ?Struts is a web application development framework (WADF), of which there are many. The proliferation of open source WADF's prompted Anthony Eden to begin his Wafer Project, which aims to compare
the many open source web application frameworks which are available using a common example application. This research project is designed to compare the application frameworks on a level field by specifying an example application so that the application features become irrelevent and the merits of each framework becomes the focus.
Anthony could probably use some help.You can find many links related to Struts on Ted Husted's page, because he's the lead developer for Struts and the author of the O'Reilly thereon.
In the opinion of some of the smarter Java developers, Struts is no longer the best of the WADF's in the Java world. Some of them seem to prefer WebWork, which is now part of OpenSymphony. Debate over Struts is raging.
Check out an attempted improvement to Struts.
-
Re:Who still uses structs? Tapestry the way to goI'm interested in Struts alternatives like Tapestry. Webwork and Barracuda are two others that look very interesting. Does anyone know if there is still any momentum with the other Jakarta framework, Turbine?
The main difference in these frameworks is how you handle the html. Struts is JSP focused, Barracuda uses XMLC and Tapestry uses HTML with extra tags, Webwork and Turbine use Velocity as a first choice and can use JSP.
I use Struts a lot now. The community is very active and helpful. There is more documentation available and with a lot of the development is by Sun insiders so I expect it to be around for a while. Unlike some, I see the JSP focus as an advantage in that it can easily include other tag libraries.
That said, I'd like to see people post advantages to other approaches. Not "Struts sucks, use XYZ!" but "XYZ is better when your site uses ABC and needs to DEF".
-
Opensymphony PlugAnother open source java tools project is Opensymphony.
- Oscache is a must for any JSP / servlet development, and allows the caching of sections of pages.
- Sitemesh allows you to decorate HTML similar to the decorator pattern described by the Gang of Four.
- Transform tags allow you to do code highlighting and xml transformations in your pages.
- WebCompass allows you to create meta-models of your site (allowing for dynamic navigation).
We use all of these features on our site. - Oscache is a must for any JSP / servlet development, and allows the caching of sections of pages.