Related
I don't have much experience in frameworks or languages, so i need your help.
Here's what i've done so far so you can understand where i'm coming from.
I've developed a web app using Java/Spring MVC/Hibernate. on the front end i've got some jquery datatables doing ajax calls to a db, another pages executes a stored prod and thats about it.
Now i got fed up with all the configuration, beans, hibernate mapppings, spring mappings, apache tiles, and the list goes on.
I had a play with Groovy/Grails and that seems so much easier, but that means i need to learn groovy and i've heard about it's performance weakness.
So i ran into Play Framework, can someone tell me if Play would make my life easier with the above scenario or should i just go into Groovy/Grails or even scala/lift.
I don't have too much time on my hands to pick up another language so if i can stay with core Java and use Play that would be great.
So is my described headache the reason why there's RoR/python-django, grails ect,ect? or is it something else?
thanks,
glenn.
I can tell you from the perspective of a 10 year J2EE developer who went from JSP/servlet to Grails to Play. 6 years ago I discovered groovy and I liked it very much, I've been using groovy and it's GSP templates in my other projects for code generation. I really love groovy syntax. Because you can do a lot in a single line of code ;) Because of groovy I tried Grails. But, besides the use of the language to code something in perhaps some 20% of the project time, you are 80% dealing with Grails conventions. How do they map this and that and to the persistence layer (which is JPA underneath the surface). So you're browsing the docs most of the time.
Then I found play. It really felt natural. Everything is so quick with it. Everything is direct, it is 80% undisturbed, productive coding, only 20% reading the docs. The code completion of any Java IDE is literally sufficient support. In Grails you either need a Grails IDE or you find yourself frequently browsing the docs.
The biggest attractor of Play to me is the hot code swap feature, which nearly completely eliminates the build phase. Play's class enhancers give you enough comfort to get over the loss of those dynamic finders in Grails. In the meantime, I even write my own enhancers to get even more comfort.
In a real project, the strongly typed Java language is a huge benefit to all developers. You just can't break it so easily as you can with groovy.
Also, if you look at the Play package, you always get reasonable defaults. Things that all developers like. jQuery based CRUD, beautiful code samples, good visual experience. And it's all as minimalistic as possible. Which means, you can always go to the play framework source itself and read the code to understand play's behavior.
So to sum up, after 10 year of Java and J2EE frustration and almost giving up on Java I switched back to it as implemented by Play, because in Play it is so much fun and I now love it again. I recommended play to 2 other developer friends and they love it too. It feels like the Java that it should have been in the first place. Fast, clean, secure & a lot of fun. I will never use something else based on Java, not even for a simple main() ;)
Play!
After 6 or 7 years of Spring/Hibernate, a couple of more with JSP/EJB I was done with the Java world, looking for other alternatives like Scala, Node.js, Rails, etc. Play Framework has made me fall in love with Java all over again, even though I do recommend Scala.
I have lots of information about Play on my blog http://geeks.aretotally.in and http://playframework.info.
It's super easy to pick up, it's crazy productive and you will have lots of fun!
If you ask a Play framework guy, he will tell you to use Play. If you ask a Scala/Lift guy, he will tell you to use Scala/Lift.
Ideally you'd like to find someone who has used Groovy/Grails, Scala/Lift, and Play, but unfortunately there are not too many of those around.
FWIW, I use Groovy and Grails, and like it a lot. If you already know Java, Spring, and Hibernate you already know most of what you need to be productive with Groovy/Grails.
If you don't want to spend a lot of time learning a new language, I'd stay away from Scala, as it's a very different language to Java, whereas Groovy is almost a superset of Java, and with a familiar syntax.
I know virtually nothing about Play, but I'd be concerned about the size of the community - check the number of Play and Grails questions on stackoverflow for a rough comparison.
Grails 2.0 performance will be pretty much on par with the static typed languages out there.
Based on your current architecture, Grails would be the most natural fit - you can re-use all existing classes and code without an issue, and have it directly picked up. You can freely use #Autowired and other Spring annotations, java code, and Grails picks it up - because Grails is Spring under the covers. The only part that might need a little tweaking are JSPs, but I was able to get existing JSPs and custom taglibs working without an issue. Grails uses SiteMesh to compose it's Groovy Server Pages (think JSP groovy-ized, and removing some of the JSP restriction gotchas).
Nothing against Play, Lift, Clojure's web framework, SEAM, or any of the other frameworks out there -- but if you want a simple transition from what you have to something a little more productive, then Grails would be the closest fit.
Of course these days, just about every one of those frameworks supports polyglot programming - you use Scala for something, Groovy for something else, and Java all around - compilers, build environments, and tools are all addressing polyglot development.
Long story short, it comes down to requirements and risk management - do you need functional programming, dynamic typing, re-use of your Spring controllers, or just some simplification and productivity boosts?
Even a simple Spring 3.1 upgrade may eliminate some of your XML files for annotations and solve most of your problems.
Happy Hunting!
I would like to start up a project from scratch. I am a java developer for years. I did even write my own mvc framework some time ago for fun. Now I am working in a company using in-house framework - which i think is a total loss of time and money. I respect the idea of teaming up with different skilled people for a large scale project. The separation of the project is very important; Graphics guys, front end developers, software architectures, software developers, database experts, etc. I cannot risk to use a scripting language like php.
Lately, I am researching java technologies for a large scale project in every aspects. What I mean by that, for the front layer I come across with very famous technologies.
Spring
MyFaces
Tapestry
Google Web Toolkit
Cocoon
Velocity
Every one of them states that it is the simplest, the fastest, the latest technology and whatsoever. Of course only one them can hold the truth. I need a front end technology for fast implementation for ajax, customer/administrator security, themes, templates, internationalization, caching static pages, clustering and a support of ejb. It should also have IDE support, community support, rich documentation and online tutorials. Still I have no experience of those frameworks which to choose from. Maybe there is even better one? And most importantly, I cannot risk to start up on a technology which has development limitations. Is there any suggestions for this layer?
For the business layer, I am sure of EJB and JPA. I do even considering a web service for facade of this layer for interoperability purposes for future extensions. However, I have no idea about securing that layer (it could be applied on its web service level) which is still a problem for me. For the application server I am considering GlassFish.
And for the last question is what IDE should be picked for development. Regarding all the technologies, which are going to be used, an IDE should help me in every step, either doing the configuration for me or helping me configuring with its ready wizards. I suppose the IDE will have proper plugins for to be used technologies.
I know that I want too much, however I have a hope for a combination of technologies which will help me saving time and money in my future plans.
I ll be really glad to hear your responses, experiences for a bigger picture.
edited: There is no ultimate answer, I know that. I am just taking advice. Any answer is appreciated.
Well, I'm going to go out on a limb and give concrete recommendations, since I think the question can be answered.
I'll simply recommend my stack.
My stack is Stripes for the front end, and Glassfish/Java EE 5 on the back end.
Stripes is a simple Action (or MVC, whatever floats your boat), that has a small, but robust and vocal community. It has tight integration with JPA (through a plug in), a very good, and current, printer book on the topic as well as excellent reference documentation. It's main rendering tech is JSP with JSP Tags and EL.
It is not a component framework like JSF/MyFaces, so it's implementation is simpler, and it's lifecycle is simpler. It works very well with Ajax.
The key factor around Stripes, since it's based on the HTTP request cycle is that it does most of the grunge work for you, yet is very lightweight. It's easy to pick up and understand. Creating a basic Stripes app is a couple lines in the web.xml and two jars (one of which is log4j). If you can think in HTTP, then Stripes is a good fit for you.
On the back end I would simply stick with EJB and GlassFish. Java EE 6 and GFv3 are out have been out for sometime. It offers a lot of new features over Java EE 5, and GlassFish offers most any web service tech you would like to use. Java EE 6 and Spring are pretty much equal on a bullet point by bullet point basis, and since you were looking at GF, you may as well use EJB since it's there and integrated in the box. If you were using Tomcat, then Spring might be a good choice.
And, that's it. That's all you need (I dunno what you wanted Velocity for, you can add that trivially if you like, but I wouldn't use it for pages, personally, modern JSP is much better IMHO).
Glassfish will secure your web services, you can use Java EE security with your web apps, you can share logic between the back end EJBs and your web app and web services. It all works out of the box with 15 minutes of configuration to get Stripes running.
I use NetBeans, but all of the other IDEs work as well. NetBeans is nice because it come integrated with Glassfish. One less thing to configure. Download it, fire it up, and it works.
There's a Stripes plugin for NetBeans, that I don't use. I don't see a need. Once you add your few lines to your web.xml that you cut and paste from the web site, you never see Stripes again. From there, it's all simple annotations.
Unless you have a crushing need for all of the complexity and learning curve of a component framework, it doesn't get any better than Stripes, and GF w/Java EE 6 has everything you need in the box.
So, in summary: Stripes distro from www.stripesframework.org, NetBeans download from netbeans.org, and stripersist from stripes-stuff.sourceforge.net. It's a rock solid foundation that will go wherever you want to take it.
Come on by to the Stripes IRC on freenode at #stripes, and we'll answer any question you have (or hit the mailing list).
Well, first of all, your question is not good. Every technology has it's bright sides and dark sides. To choose some specific technology - you need experience in all of them to estimate which problems can emerge with your project. Given your definition: fast implementation for ajax, customer/administrator security, themes, templates, internationalization, caching static pages, clustering and a support of ejb - 90% of frameworks support all of it either directly or using some plugins.
Moreover, various technologies are better optimized for various needs. You can't have a all-in-one-super-framework that is flawless and does everything the best way possible. Given that the framework is highly scalable and fast (example: Spring and/or Portlets) will make it hard to configure for some small tasks.
So the only thing I can recommend is to google "Java Web Framework Comparison" and hope for the best.
As about IDE, I can see only 2 choices: IntelliJ Idea and Eclipse. Again, there is no clear winner so yet again google is the only source of information you can get.
Added:
Talking about frameworks again, complex projects use several of them at once taking the best parts of each to aid with the specific project needs. But to do that effectively - you need to be a guru in all of the mixed technologies.
There is almost no way that someone can actually answer this question for you. In terms of frontend technology, one of the frameworks will work for you and others won't. It all depends on which one makes sense to you. My suggestion would be to try them all out and pick the ones that you feel the most comfortable with.
With that being said, I do have a few suggestions. First, don't limit yourself to using Java. If it were me, I would use Ruby on Rails running on jRuby as the frontend as it is the fastest framework for developing web applications that I have used. By running it on jRuby, it allows you to hook into Java and let java and its libraries do all the heavy lifting on the back end. I would stay away from web services and implement things using ReST.
In terms of an IDE, definitely go with IntelliJ IDEA. It may take a little bit to get used to, but it is definitely the fastest IDE on the market. However, both Eclipse and Netbeans are also very good for Java and a tad cheaper.
Once again, the answer is, "it depends".
All of the above projects started off with simple ideas. As they gained traction, they have all added neighboring features which are useful to some but not necessarily all. In other words, you will have to do deep analysis to pick the perfect framework.
You are not going to find a perfect match unless you just happen to be of like mind as the dozens of people working on the particular framework, assuming that all those minds were ever in perfect agreement. The only "perfect" fit is the one you write yourself, and even then you find it's not perfect as you are limited in time and effort on developing the framework; after all, you DO have a program to write, and the framework development time competes with the program development time.
As far as IDEs go, there's differences in taste and style. I tend to gravitate between the old standbys of Netbeans and Eclipse, and my next IDE to play with will be IntelliJ Idea. The thing to remember is that most people commit to one IDE and then defame the rest, so you really can't get a good comparison. IDEs take too much time to really learn for a person to give a honest unbiased opinion. A good candidate IDE "X" will be the worst in some eyes and be the best in others.
Given how the other answers look, I would say the biggest remaining factor is the learning curve for you and your team. Given your description of the separation of roles, your primary concern should be picking an overarching framework, such as Spring. From there, your database guys can pick whatever they want for data persistence (hibernate, jdbc, whatever) and your gui guys can pick whatever they want for their front-end (tapestry, jsf, etc.).
The primary concern I would have with such a distinct separation of roles would be the communication on the team. Make sure that their is a high degree of open communication, especially when discussing interface design, as those will be integral in the success or failure of your project (especially if you pick Spring).
As far as IDEs go, it's personal preference. The two mentioned in the other posts (Eclipse and IntelliJ) are the two I hear the most about, with Eclipse being my standard IDE for the last 4 or 5 years. I'm not familiar with IntelliJ, but I know that Eclipse has plug-ins to support Spring, Hibernate, and a host of other frameworks and ORM solutions. It also has plug-ins to support other languages as well, such as Ruby and PHP.
"I did even write my own mvc framework some time ago for fun" - at the end of the day it may happen that you will regret that you did not stay with it. In fact the technology that is better than currently "famous" most probably is the one that will be famous a little bit later, not now. Half of your list is already "famous" as obsolete.
If gathering requirements for a medium-to-large web-based project, at what point should one consider using Java-based back-end, JSP, etc, over a scripting language like PHP, Python, or Ruby?
Hearing "use the right tool...", when is Java the right tool for web-based projects?
What is the "Best" language is often degrades to an emotional debate rather than practical. Champions of each language are extremely good at making arguments for why each language is the best. I ususally look ata couple of factors:
A) What languages are you and your team confortable with?
B) Is there an existing application/system to be extended or integrated? If so, what languages are most effective for such an integration
C) Are there built in or redily available libararies, components, etc that will allow you to more effectively produce results in one language over another
My decisions almost always boil down to what language/platform is my team going to be most effective on both developming and maintaining.
In my opinion, the language decision cannot be made independently of the larger development and runtime platform. This is implied by what James Conigliaro wrote, and also by what jonnii wrote, but neither called it out specifically.
Making such a decision, people often use unwarranted relative weightings for different evaluation criteria. For example, one of the criteria might be "runs on iPhone." But if you are not actually developing on an iPhone, you really don't care.
"Performance" is another criterion that can get an unwarranted weighting. Most Intel-based servers today, costing let's say $2000 without storage, are plenty fast to support a fairly high-volume web site regardless of your choice of language. If your load exceeds that which can be run on a single server (don't assume!), or if you need to share the server among different workloads, then perf may become more important. But generally your app load will fit in a 1-server box.
The development environment, including the IDE but also the source code control, the configuration management, and defect tracking - I guess what you might call application lifecycle stuff - is more important, in my opinion, than the language per se.
Another aspect you may wish to consider is, the "pull" the language itself will have on devs for your team. In the early days of Java, you could attract devs just by saying "we're doing it in Java." Now, that phenomenon has largely faded for Java, but in pockets it may still be true for other langs and platforms. This factor may or may not be important to you.
Pick the language/platform that your team is most comfortable using, the one which matches your deployment target and that you're mostly proficient in.
I have over 20 years of programming experience and I learned one important fact: it doesn't matter which tool you use, as long as you're comfortable using that tool. For larger teams, all team members must be comfortable with the choice you made.
I always tell people that it doesn't matter which tools you used to create an application. All that counts is if it will work as expected.
I'm planning to use Java for a project served using Google App Engine (Java support, of course). This is not The Answer [tm], but only my 2 cents :-)
Whoever has the libraries you need:
If you want to customize something pre-made, use PHP. This will usually be shopping carts, forums, and CMS
Java will have more libraries for random things (like fetching RSS feeds)
Don't know about Python/Ruby on Rails;
Rails is simple to learn, well organized and well documented. It's also agile and RAD (rapid application development). It's not perfect, but you could give it a try. It's another take on the web development. Java web framework are not so easy to understand and start is not so simple IMHO.
If you have to build a large web application, with rails you could separate the monolith app with different apps and then use ActiveResource restfully.
http://guides.rubyonrails.org
Almost always :-)
What I mean is that you can do any web project with Java/JSP adding more or less to the mix ( Spring, iBatis, etc )
But, as already pointed out, there are cases when you decide to use something else because for instance your team has a lot of experience with younameit and no experience with java or things like that.
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.
This is half rant, half question.
Is it worth using Grails? I'm trying to develop a relatively simple database-driven web application. My expertise is in Java, so naturally Grails seemed like a good choice. At first I thought of using Spring, JPA and Hibernate, but I’ve used that previously and have run into all sorts of tedious configuration and coding work. Grails advertises itself as solving this.
My biggest frustration with Grails is all of the little things that don't work. What I mean is that it doesn't work as one would intuitively think it should. It's very rough around the edges. I run into problems constantly. Sometimes it's my lack of Grails understanding — other times I've discovered legitimate Grails bugs.
One major issue is the lack of good Eclipse integration. There is a Groovy and Grails plugin, but it doesn't do much other than syntax highlighting. Calling Groovy from Java and vice versa is very painful to configure. Not having good IDE support is a major bummer.
What happens is I sit down trying to develop my web application. At the end of the day I realize that I've spent about 85% of the day debugging Grails-related issues. If it isn't Eclipse problems then it's eager loading, fetching in the view, one-to-many relationships, weird empty file bug behavior, a weird property/getter bug — it just goes on and on. This is just a sample of the issues I ran into today. My last sit-down with Grails yielded a whole bunch of different issues.
I sometimes wonder if it's worth it. I'm curious if others have experienced this. Are there people actually using Grails to productively crank out a web application? Are there other frameworks for rapid web development that I should be considering?
We had a team of 12 people all seasoned senior Java devs who learnt Grails from 0.6B and we are all still working on projects based on Grails. I wouldn't go back to Java willingly, and we are all relieved to have broken the back of how to get somewhere quick with a Grails app.
It was a struggle, it was not easy and there was/is frustration.
Nevertheless we delivered something very quickly given our ongoing efforts.. There are bugs, many which have workarounds.
I have heard of several instances of developers who are good at Java trying to dive into deep, complex incantations of Grails projects. We eschewed all Java and went pure-Grails and Groovy. We made sure we started simple, built up the complexity as manageably and as practically as possible.. We dared not dive in the deepest end and hope that our Java knowledge was enough to carry us.
We had eventually created something huge and complex that worked fabulously and did so far faster than writing pure Java/Spring/Hibernate version; and thats without decent IDE support and a far worse situation in terms of bugs than today.
As regards Eclipse support, the only real IDE to use for Grails/Groovy is Intellij - the Eclipse support is way behind, sadly: I was an Eclipse lover and am far from being an Intellij convert - the Grails/Groovy support blow everything else away though.
Yes, Grails is immature compared to Spring perhaps. Or Hibernate. And I would wager that in the first 1.5 years of their existence they were equally as fraught with issue.
That being as it is, places the onus on you, to take care that you keep complexity to the absolute minimum, to carefully test-first (in our opinion) and build up to complexity gradually and with care.
There is no fast code solution with Java once you involve Spring/Hibernate in the stack. The complexity Grails embodies is a reflection of Spring's / Hibernate's own complexity. If you feel that you time is better spent doing it with pure Java, I wouldn't argue otherwise.. I still have my WTFs but now that the steep learning curve is behind me I think I will stick w Grails some more.
I very much enjoy writing grails application for two reasons:
I don't have to use Java
I can use Java
I think after having become familiar with grails one gets his things done very quickly and elegantly.
So much for the plus side. The minus side is performance, which hits me on two aspects: deployment and testdriven development.
I haven't managed to run more than 3 grails applications on a single (rented) server, because I quickly hit the memory and performance limits. There are simply too much frameworks included.
Plus, the testrunner of grails isn't worth that name. When I run unit tests, they should be done in an instant, not in 10 to 20s. So I find myself all the time writing business logic in plain java, because I can test it much faster. But I guess that this can be addressed with a better integration into the IDE (eclipse).
I think Spring's support of Grails is going to be a big boost. If anybody can move it past CRUD on the web, it's those guys.
I also think it's reaching a critical mass. There are several new books that will be hitting the market in 2009. I think those will help the adoption rate.
I fully agree with the original posters sentiments.
We are a Java + Spring shop and took the opportunity to try out Grails.
We first created a very small test application which turned out to be pretty simple to do and it worked pretty well. The main issues we had here were due to our lack of knowledge with Groovy and Grails.
Following this success (confidence boost) we decided we would attempt a slightly larger project. This has been a much more painful experience. As mentioned by others, we have uncovered all sorts of bugs and issues which were not immediately apparent on the surface. The app restart cycles get extremely painful and unless you have really good test coverage its a nightmare to do any sort of re-factoring.
Really frustrating is having code fail without a single error message! It just does not work and you don't know why?
I like the ease of use of plugins for JMS, Quartz and Remoting to name a few. Does away with a lot of tedious XML.
I almost like GORM for its simplicity though we have had several issues as well.
I don't like the loosely typed nature of Groovy and the fact that you have to run your application just to be able to catch a bunch of errors, reminds me too much of PHP or Rails.
At the end of the day we are asking ourselves if its possible to write a complex piece of manageable software using Grails...
We have a Grails application about to go into production....so we will see.
We are using grails + on the web layer + java with hibernate and spring on the service layer. It's the classic three layers (web, logic, data) where the web is grails and the logic is implemented in java. As is usual in java, we use bean objects that represents the data between different layers.
It works pretty well and it was the best solution for our case as the bean objects were already there, as well as the database structure. From our experience, I think grails has a great value as the web presentation layer, but I would stick with java to write the business rules and to persist the application data - as grails "is" java, all the grails-java integration is pretty straight-forward.
We use eclipse to develop the grails application and it's poor integration, as people said in here. But, as a suggestion from other developer, we run the grails application from the command-line and only use eclipse to save the source files, and it works pretty well, as the application is updated on the fly.
I yet don't feel comfortable for using grails in other places than in the presentation layer.
I have a lot more experience with Ruby on Rails than I do with anything in the Java world, so I'm coming in from a different perspective. Overall, Grails is much more rough-around-the-edges than Rails is, partially due to its immaturity, and partially because it relies on two insanely complex frameworks under-the-covers (Spring and Hibernate). Rails also has a much bigger community.
But, Groovy as a language has made huge strides, and is a pleasure to work with. Thanks to the improvements made in Groovy 1.6, Grails is quite a bit snappier than JRuby on Rails, and you get amazingly good XML support via GPath. There's a lot of nice features you get by being on the JVM (like concurrency and tons of threadsafe code), but without having to muck about with Java (a language I don't much care for), so I'm having a really hard time of convincing myself to use anything on MRI.
Python is looking tempting, though, I must admit.
As for your Eclipse problems, I can't help. I use Vim and Emacs, mostly because I can't stand using IDEs. For dynamic languages like Groovy, Ruby, and Python, though, I don't think IDEs really introduce any real benefit, as there isn't really any place for code generation, or a need to compile. Maybe try working sans IDE for awhile and see if things are smoother?
So, yeah, I think Grails is worth it. They've done a helluva job in getting things working as quickly as they have, and the Grails and Groovy teams are both really, really dedicated.
I am totally with you! Grails still feels so rough around the edges that it's almost a joke to compare it with Rails. If at least the error reporting was a little bit better. But I guess that's probably also due to the huge amount of libraries that it uses under the covers. One word: stacktrace! I am also not a big fan of the model->db approach (Rails has db->model). The scaffolding also leaves much room for improvements. Then "no restart required" also does not work as advertised. (I am not sure what's worse - having to restart all the time or sometimes finding weird behaviors that go away when you do restart) And don't get me started on GORM. (When it takes hours to find a way what would have been a simple SQL you start to wonder whether this whole ORM really saves you time) Maybe as long as it is simple.
I mean: it's still one of the better choices of a framework when you are coming from the java world. (So much useless crap out there that calls itself a web framework) ...it has potential. I just wish it wouldn't have build on top of so much other complex stuff.
Anyway - let's hope these things get sorted. At the moment I am lurking at playframework.org which also looks very slick and promising.
It will be worth it when they finish the eclipse plugin. The sooner the better I say. Trying to sell groovy to my boss isn't going to be simple until that happens.
I find that the biggest advantage of Grails is that I don't have to care about the database anymore - the schema is automatically created / updated, and the persistence is largely done for me (no more writing SQL queries). This is a huge relief. The other thing that is rather nice is that once you settled on the templates for controllers and views, adding new domain objects is pretty fast. Although I suspect that you will do ongoing changes for your views at least, back-fitting them to the existing ones.
As for the IDE - it seems that IntelliJ is the best option, but I'm happy using Netbeans 6.5. I use MyEclipse for all other development, but Netbeans just has better Grails support now.
I was an Eclipse user before I started using Grails. It was quickly apparent that wasn't going to cut it. So I tried Intellij and NetBeans. At the time Intellij was better as far as Groovy and Grails were concerned. However, NetBeans was free and that made it good enough for me. Since then all three have had new versions or new plugins released. I am still using NetBeans because of the cost of Intellij. With the acquisition of G2One by Spring Source one of the expectations is more support for Groovy and Grails in Eclipse. This will be necessary for increased adoption.
Using Grails for a new project is wonderful. So much of the Enterprise Java baggage is no longer necessary. I can imagine trying to port something would be difficult because until you understand where a framework strength's and weaknesses are it is hard to utilize it efficiently. It is promised that JSP support will come easier in Grails 1.1, I don't know if using a beta version while trying to grok a new framework is a good idea. The testing has also gone through a major revision for the new version. If time allows you may consider waiting as the 1.1 release should be very soon.
If you have an opportunity to give Grails a try in a different IDE when starting a project from scratch I think you will see it in a different light.
I have just started using grails on a new project...not having to write ANY xml files yet still have the power of Spring and Hibernate is truly amazing.
Use IntellijIDEA for the IDE though, I actually discovered Grails through the IDE (I might be biased though, I hate eclipse).
Totally. There are so many Java frameworks that the bar is set quite high for newcomers, and it's a testament to Grails that it was able to rise above in such a crowded space.
It still has a few edges that are sharp, but those are just a matter of time before they're matted down, the underlying project is VERY much worth it.
Grails might be to big for your type of application (based on the numerous files it created on the first initialization and the resources it takes). If you're looking for something simple, Grails might not be what you're looking for. If you are looking for something simple and works, so far I reckon django can do your job well. Take a look at how simple (how many files it requires) to create a CRUD apps from its tutorial. From here, your apps can (relatively) easy to scale as your needs and requirements grows.
I'm not sure they will ever be able to make Grails right you know. And by right I mean address all the details (small and big ones) which in the end makes it feel brittle and fragile. I'm not even sure that there is a real development team (meaning more than 2 people) behind it.
Every single time I iterate over a feature of my Grails projects, trying to improve something, it is the same workflow: everything falls apart, then it's a hundred of 'google' test cycles, then you find out the reason you can't do what you want and you do something else.
In the end, you're frustrated because you don't even want to touch anything that runs. And things that don't well, you drop them!
I'm considering a switch to Rails via JRuby. That may be the best of both worlds: a capable web framework with an active and large community, a dedicated team of developers, a platform which is not based on questionable and complex frameworks like Spring or Hibernate, a quick and ambitious release cycle. And JRuby because frankly, so many Java assets in my backpack, I can't just throw them away.
If your expertise is in Java as you say. You should have a look at Play Framework - it's a web framework inspired by Ruby on Rails with a very short development cycle - just save your Java source file and update your web browser. And if you want to try another language, Play Framework has a module that let you use Scala instead.
I like Play Framework since it's easy to understand and has good performance. You can also use JPA and Hibernate for the ORM-layer if you want.
I'm trying to learn Java but it just seem like there are too many parts to put together.
You have JSP, Java EE, Java SE, Java ME etc....
I can get Netbeans to do basic but just taking a peek at spring framework it seem like a lot of work to get it to run in the ide from the numerous configuration .
I want to get into web programming and maybe mobile.
Any advice?
Another programming language?
Is java this complex or does it get easier?
Java as a language is certainly not too complicated. J2EE in its entirety is only just about feasible for a one-man team - but you rarely need the whole of J2EE.
It's perfectly reasonable for a one-man team to implement a medium-sized web application. I'm not saying one person could write GMail on their own, but you shouldn't be too scared of the technology stack - find the bits you actually need and concentrate on those. On the other hand, that in itself takes a fair amount of experience - I wouldn't really want to be starting off on an enterprise app (even a small one) on my own as a newcomer to Java.
Start small. Learn the core (the language, IO, collections) - and then start with small projects. Work out whether you want to be in mobile, desktop, server or whatever - don't try all of them simultaneously. Gradually you'll build up your experience.
It's not that Java-the-language is complex, it's that vast libraries and frameworks exist that can help you do your work. This is true for many programming languages. Look at CPAN for Perl, for example. What language to use depends in great part on what your goals are.
You can start simple and work your way up to larger and larger projects.
Java is by no means too complex for a one-man operation, but learning any form of full-formed web programming is a lot to learn when it's all new. If you were looking at .NET for the same purpose, there is a lot there too.
Unless you are doing huge-enterprise applications, ignore all of J2EE except for JSP and JMS and a very few other components. The lion's share of J2EE is only useful in the context of an enterprise application that needs to scale, and in fact can be harmful when used in smaller applications.
The frameworks such as Spring, Hibernate, Apache-*, Web Services, and so on help you do your job, but are yet more things to learn to do your job. There is a lot to learn.
Should you use Java? Well, quite a lot of development is done with LAMP (or WAMP): Linux (or Windows) + Apache-HTTPD + MySQL + PHP. With this, you don't need to worry about Java or .NET or any of those frameworks. LAMP/WAMP works very well for a wide class of applications.
Java and .NET on the server are (sort of) more appropriate for larger services, but once you are familiar with them, they work just fine for smaller services as well.
You have to decide what your exact goals are, then look at how people have implemented the kind of thing that you're looking at doing. This will help you figure out what technologies are the most necessary for the niches you're looking at going into.
Java -- the language -- is one of the simplest strongly typed languages in existence. Vastly simpler than C++ or even its close cousin C#, I would argue.
The standard APIs/libraries really are huge, but nobody learns the whole thing. You're suffering from the intimidation all beginners feel when they look at something that big and new, but this will pass as you just do stuff. First, you need to learn the standard utility stuff -- the collections in java.util, mostly -- and then, for basic web dev, probably next the JDBC library and Java Servlets and JSP. And that's it.
As an alternate tact here...
Another problem you will encounter in Java is Choice. You have a LOT of it in terms of frameworks and technologies etc.
My best advice is search around for about a day if you're so inclined to find what technologies attract you, or who's arguments sway you. Then, pick one. ANY one. Really, it doesn't matter, especially for a first project. They all have learning curves, they all have strengths and weaknesses, they all have fans and foes.
The key though, is once you have chosen, STICK WITH IT. You will inevitably stumble upon some problem, you will pose this problem to someone else, someplace else, and they will say "oh, you should have used QED instead of KnifeForkSpoon". And you will second guess yourself, go off and hear about the wonders of QED, and all of the kittens born under it and hungry children fed by it. If you succumb to that siren song of "greener grass", your project will flail. (Not fail, flail.)
Don't be wooed, don't fall for it. Just fix your problem and move on. At the end, and you're on a new project, THEN go and look for the more bestest greatness silver bullet.
As an aside, if I were just getting in to web programming today in Java, I would humbly offer this simple recipe:
JSP 2.0 with JSTL for markup and presentation
Stripes or Struts 2 for logic (note Struts 2 (TWO), Struts 1 is plain evil)
"raw" JDBC with a database pool for persistence
Tomcat or Glassfish for a container (tomcat more popular, GF easier to use out of the box)
Netbeans or Eclipse (NB is easier to use out of the box)
This uses the most fundamental, yet functional facilities for web apps in Java today, lots of applicability, and solves the major issues of a web app without covering them up with thick, impenetrable layers.
You will learn a lot using these "crude" tools.
You need to learn to pick your battles. Covering the whole J2EE is a massive task and, for most, unnecessary to begin with. I think a common mistake for beginner programmers is that they think they need to learn everything. You'll find your time much more productive if you focus on the core language constructs to begin with, and focus on either web or mobile programming.
You'll be extremely surprised (and pleased) at how much you can carry over from one area to the next. Once you know the language, the different libraries for different platforms are just tools...Stick with Java. It is a good language to learn.
Can I take "get into web programming" to mean that you're just learning web programming in general? If that's true, if you have the time you might consider setting Java aside temporarily and giving LAMP/WAMP a closer look as Eddie suggested. (Though I'd personally use Perl instead of PHP. PHP is sexier resume fodder and lets you do some very cool things on the front end, but in my experience, when it comes to writing server-side code Perl simply blows PHP's doors off. And I've heard that the HTML::Mason extension puts Perl on pretty even footing with PHP's front-end niftiness, but I haven't used it myself.)
I've made a living writing writing web apps in Java and web apps in Perl. I'm fond of both languages, but as a learning tool, I'd put Perl well ahead of Java. As you're finding out, Java's a bulky bastich. Part of that is, as others have mentioned, a function of Java being a mature language with a variety of extensions that are unlikely to apply to your immediate needs. But even stripped down, you'll still need to deal with quite a bit of overhead before you can even get your first "Hello World" web app to run. Comparatively, you'll get rolling much quicker with Perl.
(In fact, Java tends to be pretty verbose in general compared with other languages. That's not necessarily a bad thing; my one big complaint with Perl is you often encounter code that leverages various shortcuts and side effects to do an unholy ton of work in just a few lines. This code is often brilliant, elegant, compact, and utterly bloody unintelligible to a non-expert. Terseness is not a virtue for the poor idiot who has to modify code six months after it was written -- especially when you wind up being the poor idiot in question.)
And as a way of learning web programming, Java's sophistication can actually work against it. As a professional, I'm glad Java's web-based tools automagically take care of a lot of grunt work for me, like session management. But I didn't completely understand what it was doing until I was thrown into a Perl-only environment and had to deal with all that stuff myself.
I guess it depends on why you're doing this and how much time you can devote to it. If time is limited and you're looking for something that will appeal to prospective employers, then yeah, Java's an excellent choice, and you've gotten some solid advice in this thread about how to get started using it.
But if you do have the time, I highly recommend giving old-school Perl/CGI programming a sniff. It ain't a particularly marketable skillset anymore, but you'll learn things worth knowing.
You don't have to learn all of Java and its libraries. Just learn what you need for the job at hand. You will find there are plenty of options, but you don't have to get the best option every time.
If your base programming concepts are clear no
language should be difficult for you. I have switched over from vb 6 to java to c# to objective c now. What really makes a coders life easy is the IDE, debugging tools, documentation and lot of blog posts which google can search :-) regarding one man team my personal view is I am at my best when left to code and research alone with the help of google and stack overflow ofcourse :-) so I do think in programming large sized teams often lead to more screw ups than results
Java is not a complex language, altough it looks frightening at first.
I started learning Java from home, not a school, at 15 years of age (yes, yes, I know that's nothing to brag about) trough a book. It's a norwegian book, so I won't link to amazon;)
After reading/hacking trough half the book I found out I was better off ditching the book and looking for more stuff online. Google really IS awesome!
I would often read about all the fancy features of the JVM, frameworks, third-party libraries, JSRs and so on, and how much better my life would be with them all, but I just ignored them all. Yes I tried, but found it too confusing to learn Java and a framework that wasn't really necessary, at the same time.
Some people gave me hell for not using insertRandomLibraryName() or insertFancyFrameworkName(), and told me all about how much time and effort i would save, but I'm glad I didn't listen.
Now times have changed, and I still learn new things, or easier ways to do old things, every day. And I'm glad I took the time to learn the language itself before all the fancy stuff.
Also, don't use a notepad for writing code, use an IDE from the beginning. The only one I've ever really used is NetBeans, so that's the only thing I can recommend, but I sure am really happy with it!
As to Java SE, ME and EE, start with SE, and you'll propably find that it's enough for now. You don't have to use EE to write for the web, SE is fully capable of webernet stuff;D