Domain: springframework.org
Stories and comments across the archive that link to springframework.org.
Comments · 39
-
Re:Objective-C was ahead of its time
Nothing speaks agaisnt a vm-less, class loader less, vtable based, method dispatch WITH reflection and introspection.
Sigh. I agree with this, but point out that C++ and Swift don't provide these, and that vtable dispatch creates an array of method pointers, and unlike objective-c, does not preserving the method names. This information has to be added on separately. Java 1.0 didn't include reflection. Even if I was mistaken in this, there is no need to start making personal insults and calling this "retarded".
Important (for you):I think you might be missing the point about method interception. Are you familiar with this concept? In Objective-C we call this method swizzling. You can either swizzling the look-up table for a method (modify all instances) or change the isa pointer for a class - modify a single instance.
In the Objective-C community, swizzling is misunderstood to be a hack, but it affords all kinds of useful features, such as Cocoa's elegant property observers, Core Data managed objects and such.
People also misunderstand that this has nothing to do with introspection and dynamic invocation. In Java we can do the following:
- * Before a class is emitted from the class-loader, emit a run-time generated sub-class, where methods are proxied in the same way as above. Libraries like asm, cglib and javassist do this. Spring uses cglib to proxy concrete classes and provide AOP such as declarative transaction management and security. Hibernate uses it to provide 'managed objects'
Er, to emit a runtime generated sub-class of a class, just prior to it being loaded, does require a class-loader, which in turn requires a JVM. Many people outside the Java community don't relaize this, but it gives most of the benefits of Objective-C's (messaging) late binding, although it does not allow arbitrarily adding new methods to a class.
I do know something about Java, having made some contributions to the framework that revolutionized enterprise development, and going on to teach it around the world. Later I created my own framework to help Objective-C developers implement a design pattern that is well understood among Java developers.
I enjoy discussion, I'm open to being corrected if I make a mistake, but if you would like to revert to childish insults then I don't have time to participate. I'm interested in sharing my knowledge and learning new things.
-
Re:Java too complex
The problem with "making all those decisions for you" is that writing good programs is hard and writing good frameworks is harder. Therefore, all else being equal the chances are that any given framework will suck. Five years ago Java had several hundred web development frameworks. 99% of those sucked and nobody used them, the others were built on the lessons learned from the sucky frameworks' mistakes, as well as the rare bit of genuine technical vision.
We've ended up with the Spring framework in Java, which is a top-notch web development framework; the first one I've met that really truly does not suck, and web development isn't even the main point of Spring. Contrast that with the decision Microsoft made for your web development needs in the form of ASP.NET, which is pure unalloyed garbage. It's built around some completely ridiculous metaphors and tries to fight every reality of the web platform, leaving you with a programming environment that's about as flexible as a brick. You can build dumb intranet web views that are completely un-abstracted and welded to the tables you've laid out in your SQL Server database, with rather limited control over any non-elementary features over the DBMS, and if you try to step one inch outside of that mindset then it fights you every step of the way.
That isn't even an indictment of Microsoft's technical development practices as it is a reflection of the fact that they only tried once and (since the odds were against them) they blew it. Many Java frameworks that were as bad as ASP.NET or worse came and went, what survives today is far more likely to be made of stronger stuff.
Fortunately for Microsoft that doesn't matter, because in most organisations the people responsible who choose the organisation's preferred technical platforms are not the people who actually have to use them. As long as their effort can be used to rapidly create a facsimilie of the equivalent demos found in the Java glossies and the number printed by wc -l is smaller in their version than Sun's they're fine.
-
Spring!
Wow, he already answered the question himself:
I will be teaching an enrichment programming course to 11-14 year old gifted children in the Spring
Spring it is! -
Re: Any Pretty Code Out There?
As you note, the answer is mostly no. In my experience, it is the experienced people who are more likely to complain about code quality, as they can better recognize it and value it more. I just wrote an article about the need to make code more 'pretty': Why You Should Polish Your Code. One code base that has consistently impressed me is the Spring Application Framework, which is open source and written in Java (I'm primarily a Java developer). I've looked at other popular open source Java libraries and generally have not been impressed by their code quality, so I don't think that open source is any guarantee of prettier code.
-
Spring
If you want something from the Java world just look at Spring http://www.springframework.org/. Its design and code are both great.
-
Re:Which is why India's looking at thorium...
Maybe too subtle.
-
Re:Damn Straight
Server-side Java is anything but dead and not just limited to EJB -- especially Spring has quite a growth potential.
-
Re:I go to Sourceforge after I learn about a progr
I'm a big fan of http://plone.org/ which is a CMS that sits on top of the http://www.zope.org/ application server. All of which is OSS. I can't speak to OSS CRM but others here have. There are plenty of fantastic server side developer productivity boosting OSS software out there.
- Try http://jakarta.apache.org/ for lots of Java libraries.
- I find http://www.springframework.org/ is a great framework extension for Java.
- I like spring better, but http://www.hibernate.org/ provides an ORM for both Java and
.NET developers. - If you are working in Perl, then http://www.cpan.org/ is the place for you.
When it comes to client side software there is a huge amount of great OSS apps.
- I believe that http://sourceforge.net/projects/ganttproject/ is great for project management.
- I have used http://sourceforge.net/projects/freemind/ for years and know it to be a great mind mapping tool.
- I believe that http://live.gnome.org/Dia/ is a great diagramming tool.
- I'm a big fan of http://www.umlet.com/ and find it to be very useful for creating UML diagrams.
- I switched from sodipodi to http://www.inkscape.org/ which is fantastic for drawing vector images.
- I am also a big fan of http://www.gimp.org/ which is used to draw raster images.
I have used all of these projects for years and would most definitely label them as quality, winner OSS.
-
Re:.NET
Or you can use an add on like Spring http://www.springframework.org/
-
Re:Java != Javascriptd for the type of content
Google's toolkit is kind of nice for Java developers but seems pretty intrusive to have a layered design with front end stuff done with Java. Dwr (direct web remoting) has a decent toolkit that allows you to call Java code through javascript by generating javascript files for your Java code. It also integrates well with the Spring framework.
-
Re:Starting to show???
Only Sun's Java offerings are really stagnating. The real improvements are happening outside of Sun. If Sun were to give up control of Java by open-sourcing it, it would do wonders for Java, but it is by no means necessary.
You'd be surprised at how well accepted projects like Spring are among PHBs. Spring is quickly getting a reputation for allowing projects to deliver on time and budget (if not under). I was privileged enough to attend the Spring Experience conference last December and there were a number of really large companies (some of the biggest names from the financial, tech and retail sectors) that sent quite a few people there. Most of those I talked to said that those companies had basically dumped EJB and were using a Spring-style approach to new projects. Developing apps with Spring's IoC and AOP capabilities really does give you the faith that your application is rock-solid. And that kind of stability is something that, in my experience, management absolutely loves.
That's what's really missing from pieces like the linked article...any middlework framework for handling all layers of your application. Sure, that Smalltalk view framework might make creating intelligent components dead simple (doubtful, but possible). But how do you test them in isolation? How do you test the business layer below them in isolation? (and, of course, how do you test the data layer below that in isolation?). Spring offers a dead-simple way to do all of this. I've yet to see anything outside of the Java world come close. -
Re:What is your current application environment?
Please ignore the parent. Spring (http://www.springframework.org/) is not a web application framework.
There are probably a lot of gains to be made by switching. If your people really are as good as you say then the language itself wont matter much and you are gaining a lot of libraries and knowledge from the massive amount of real development being done in java. -
Re:Kudos to RoR...
Ahh, the lament of the developer who hasn't yet discovered Spring...
And unlike Rails, it scales beyond three concurrent users. -
Re:Java frameworks: Which are good for web apps?
Learn Spring. The rest of the pieces will fall into place.
As for MySQL, I don't bother with it because of the license issues. Basically, pay for a license or GPL your code. -
Re:Cred, where on cred is due... sigh>> could you tell me a good book to look at for building Java/Linux apps?
No, Java consists of so much stuff, it's simply not possible to cover all of them in a single book. What areas are you interested in? Web app? Distributed app?
Anyway, Below is a list of popular and free Java stuff you may want to have a look
- Build Tool - Ant (http://ant.apache.org/)
- Unit Test - JUnit (http://www.junit.org/)
- Application Framework - Spring (http://www.springframework.org/)
- Security Control - Acegi (http://acegisecurity.sourceforge.net/)
- UI Framework - JSF (MyFaces) (http://myfaces.apache.org/)
- J2EE/Web Server - JBoss/Tomcat (http://www.jboss.org/)
- OR Mapping - Hibernate (http://www.hibernate.org/
>> i've been playing with it for years (java coding in both windows and linux) and buying various books that look interesting and every time i play with it for a few hours i keep feeling like i'm fighting the system rather than actually getting work done.
The Java community is extremely strong. If you ask the question precisely, most of the time you will get the answer.
>> with .NET i've never actually bought a book and i can build large complex projects fairly intuitively (google for help from time to time).
If you can build the applications "fairly intuitively", I can't see how "large complex" these applications are. -
Re:Aspect-oriented?Sure.
Mixins are a good example of AOP doing something powerful. AOP is a particularly good way of augmenting the functionality of objects without actually having to make those objects aware of that functionality by explicitly inheriting an interface.
You can find a good example using a Lockable interface -- to make an y object temporarily immutable -- in the Spring reference documentation.
-
Re:Java is your friendNow I'm really sad... EJB's? They're awful, for so many reasons.
Now Hibernate, especially with Spring transaction management is much easier to deal with for most cases. And it works very simply, and there's even a native SQL-like object query language called HQL to help. And it writes very efficient SQL queries (I've done a lot of investigation on this on objects backed by tables with tens of millions of rows) to the back end, is entirely DBMS-agnostic, and is apparently the basis for many of EJB 3.0's enhancements over 2.0.
Most J2EE devs don't get much choice on this stuff, but if you do, learn these 2 frameworks. They're even Open Source (and free-as-in-beer) so you can hardly go wrong, really.
HTH
Dan
-
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.
-
Re:DWR and JSON
DWR integrates integrates nicely with the Spring Framework (see this blog entry for an example), which is why I've been using it in my apps lately. Very cool stuff!
-
Re:Maybe, but it doesn't work with databases...I understand your frustration. One workaround I've seen uses the Spring framework's annoyingly-named AbstractTransactionalDataSourceSpringContextTests
. Your test classes subclass that monstrosity, and after each test method is run the transaction is rolled back to avoid mucking up the DB for subsequent tests. When you test DAOs, you have to have a custom method for inserting test data before or during each test. Once you get above the data access layer, you just use your now-tested DAOs.It requires you to define the way you get your database connection through Spring, but that abstraction is necessary for unit testing DB-driven apps anyway. On one of my projects, I have one set of bean descriptions for unit testing which connects right to the DB and one set of beans for when the app is running in a Tomcat container. It's not a perfect method, that's for sure, but it allows me to unit test my code pretty painlessly once it's set up.
-
Re:Read the "fine" article, please
"If a company wants to run a giant professional website and has money to throw at it, they'll get WebLogic or WebSphere to run it."
Or they'll forego bloated commercial app servers and EJB and go with a lightweight open-source framework. These aren't toys - in fact the EJB 3 standard being developed now is largely based on ideas copied from these frameworks, as well as the Hibernate open-source persistence service. -
When I first read the title...
... I thought it was something to do with the Spring framework. It's not.
-
Re:Credit where credit is due.
That's why projects like Spring have become somewhat popular. I use it a lot, to avoid all the EJB ugliness and any dependency to a particular J2EE container. You can declare your own JDBC connection pools, configure a lot of beans (not necessarily EJB's) as singletons and access them through an object called ApplicationContext. It's really cool. And for persistency I'm using Hibernate, which CMP is trying to catch up with.
-
OSS community missing opportunity
The open source community needs to find a way to move into the business application sector in an effective manner. I don't believe that it will be by using low-level tools like
.Net or Struts. It needs to come through leveraged frameworks like Compiere, Spring or Open for Business. -
Beware of EJB's. Make it lightweight JavaPersonaly I prefer Java. BUT you need to be aware of a couple of dangers.
First of all don't use EJB's unless you have to. If you don't need distributed transactions then stay away. You don't want heavy weight frameworks to drag you down. Read: Better, Faster, Lighter Java. http://www.oreilly.com/catalog/bfljava/ For a free introduction read: http://www.onjava.com/lpt/a/4744
My personal advice is a stack made of:
- JSF for the webfront. Struts if you are a bit more conservative. http://struts.apache.org/
- Spring for the business logic. http://www.springframework.org/
- Hibernate for persistence. http://www.hibernate.org/
Don't forget to have fun.
-
J2EE and webappsIn my opinion, I think that webapps are the way to go with a project like this. I say this because we currently have an old legacy application that uses Borland C++ Builder, and it is very difficult to manage the all of the versions being used by staff members. As we've moved the functionality over to a web portal, we've been able to spend less time distributing executables and more time developing features.
A webapp has the strength that all you need is a web browser to view the content. When you update the webapp, all clients are updated instantly, without having to push something out to them, or making them download something. This saves a lot of stress and headache.
There are many technologies out there for writing a database oriented project like this a lot easier. These include
- Hibernate for object relational mapping and cross compatibility with most major databases (ie, develop on MySQL, deploy on Oracle, Informix, whatever you want).
- Spring which manages your mappings and helps maintain consistency across your data connections and helps you abstract your business logic, keeping it out of the actual pages. It also integrates with . .
. - Struts which gives you a great Model-View-Controller framework to practice good development and good security.
Apache Tomcat, JBoss, and many of the other java based application servers are supported on many different platforms. You can run it on Windows, Linux, Mac OSX, and virtually any hardware provider you want.
I've been working now on this project for 6 months, and I have to say, I love the structure of this way of working on webapps far more than the common hodge-podge of php or perl. This isn't to say you can't program a nice, easy to maintain app in these languages, just that there is a nice framework with examples and plenty of books to do it in Java. -
J2EE Development without EJB
Expert One-on-One J2EE Development without EJB by Rod Johnson, Juergen Hoeller.
This is an excellent book with great advice about many aspects of software development. As the title suggests, it describes how EJB is not necessary for most J2EE projects, and offers alternative solutions to many of the problems EJB's solve. It does center around the Spring framework, as the authors are the creators of that framework, but it does give other technologies a fair chance.
I've personally found the strategies and technologies discussed in this book to be very useful. My new projects are developed in a manner largely based on this book and they've been pretty successful so far. -
Re:Maybe its designed to sell more servers
The good news: Apache Geronimon. Free, documented. 'nuff said.
More good news: Spring framework, Hibernate, iBatis.. -
J2EE Development without EJB
Have a look at Rod Johnson's somewhat repetitive but still quite insightful book about the lightweight container movement.
-
Spring Framework
I was in a similar position a couple of months ago. Then I found Spring Framework. A very nice middleware/framework for J2EE servers. It doesn't use EJB at all and is much cleaner and easier to use. It still requires a J2EE container, but since it doesn't use any EJB it is much faster. Very impressive and saved me when I had two weeks to delivery.
And yes, its free (as in beer).
-
Re:Where to go ?
Who needs EJB when there's Hibernate http://www.hibernate.org/ and Spring http://www.springframework.org/. Persistence, Transaction Management, and SQL generation in one tidy package. And it works on any J2EE app server, no matter how lightweight or robust.
Not that I have qualms with any attempt to provide these services in PHP. It's not a matter of having just one tool in your toolbox, but rather knowing which tool is right for which job. My only response to the original poster is "I don't want to start a flamewar, but if you aren't a sound enough engineer to know when to use which tool, you pretty much suck." -
Re:Where to go ?
You do realise that J2EE is not a synonym for EJB don't you? And that xdoclet is one of the worst villains when it comes to meta-data hell?
Do yourself a favour, stick with J2EE, dump that p-o-s EJB and use Hibernate and Spring and you'll do fine: and be amazed how much you can achieve if you don't tie yourself to the EJB dead horse. Seriously: you'll thank me.
-
Re:So what is it?
It's a object relational persistence Manager for Java, kinda like JDO. Nifty little tool so you don't have to make your own persistence calls with JDBC, saves a lot of keystrokes. I bought the book and it shows a lot of different tricks, and with Hibernate's QBE (Query By Example), saves a ton of time debugging dynamic SQL Calls.
I've been using this for quite a while, coupled with Spring you can write a lot of robust reusuable objects, if you utilize java's OO design methods. -
The EJB BibleEvery you need to know about EJBs is in this book.
And yes, Spring is an incredibly powerful, flexible, and *simple* framework to use. I don't know that I've ever used the terms elegant or beautiful for software remotely related to J2EE, but Spring is amazing.
And no, I'm not involved in the project. Just a happy user.
-
Re:Book recommendations
You should be happy using servlets and jsp
Um, no thanks. JSP sucks. Having code in the UI layer is a big no-no. JSP's are hard to maintain. I agree with you that J2EE persistence with EJB's sucks, but you can certainly do a lot better than jsp and servlets.
Check out Tapestry, a much better way to write web apps than JSP, using MVC so that your html page is just an html with certain id's on some tags, and you have components that can be placed inside other components to make up a page. Or use Struts. Or Velocity. Or Turbine. But please, if you can avoid plain JSP's, then stay away from them. They lead to all kinds of nastiness in your apps.
That, together with other projects like Hibernate, which is a very good persistence layer (so good that it's going to become the new JDO; they're already adopting HQL for the new EJB persistence) and Spring, which you already seem to know, you can build much more elegant apps than using JSP and servlets.
-
Re:Move along, nothing to see here..
The major problem Java has is EJBs: everyone in Java-land seems to think that their problem requires solving using this pile of crap. A web application with persistence- ooh we'd better use EJBs then!
So help us change that perception, switch to Spring and tell everyone about it. -
Check out spring...
I used struts for a short while on a previous project, it seems to have gotten a little bloated recently though.
A framework I am working with currently is spring.
Spring is a superb framework for Java development and includes a pretty impressive MVC web toolkit as well as many other tools and features. The AOP stuff is very nice and the whole inversion of control/dependancy injection implementation simplifies code drastically.
Ive used quite a few different frameworks, but so far... this one is my favourite. -
Re:It's all in the constructors
"Constructor-based Programming" is approximately the same as Dependency Injection which is related to Inversion of Control which means if you program in Java, you should look at Apache Avalon, PicoContainer, and/or the Spring Framework. Enjoy!
-
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