Is Spring the right choice for me?
I want to start developing a little web-based game, and would appreciate some advice before I get into it. Hopefully t开发者_如何学编程his is the place to ask!
The game is basically a fantasy-football style game, where you create a team of players which compete against other users. Nothing fancy.
I haven't coded much since college, and am very rusty. I want to code in Java for a couple of reasons:
- It is the language I am most familiar with.
- What limited development work I have done since college has been in Java (I have some novice-level experience with Tomcat and Glassfish, i.e. I have got them running and deployed basic webapps I've coded from scratch to them).
- I really like what I have seen of the GWT framework so I would like to develop my GUI with that.
The last time I did any programming was about 3 years ago when I wrote a web front-end for a crappy helpdesk system that only had a thick client and a web API. That was done in Java.
So basically, first up, I want to get a skeleton game up and running. Basically allow a user to log in, see their team, log out. So my questions start with:
- Is there a particular development framework I should be reading up on? I've seen Spring recommended - is this a good choice? I've found this to get me started if it is the appropriate choice: http://static.springsource.org/docs/Spring-MVC-step-by-step/
- What is the easiest way for me to handle login/authentication/authorisation without having to write a security system myself? Hopefully there is some kind of framework/library I can just drop in to the code? Or does Spring Security handle that?
- I really like GWT - are there difficulties integrating that with Spring?
Many thanks for your time, I really appreciate it!
- Spring is a good choice.
- Check out the Spring security module. It's based on aspect-oriented programming ideas.
- Looks like Spring does support GWT. It's relatively new (May 2010).
If you're rusty with Java, you might want to minimize the new technologies you introduce at one time.
Java's an object oriented language, so you can write the objects you need to model your game and get them running without any UI or database at all. That would allow you to focus on the game, the objects, and the use cases without getting wrapped around the axle with UI, security, persistence, etc.
Once you have that sorted out and fully tested you can turn your attention to the other features: persistence, UI, security, etc.
Maybe you can try basic authentication/authorization before you dive into Spring Security.
If you bite off too much at once you'll never get this done. Take small steps.
Spring is the par exellance example of what the cool kids don't like about Java. Many, many configuration files that make every aspect of the app customisable but is difficult to keep in your head where stuff belongs. If you are not a huge company this is almost certainly not what you need.
I would encourage you to look into the Play or Wicket framworks if you want to keep using Java. Both are conceptually simpler, don't throw in the kitchen sink and are heavily geared towards web sites. Spring MVC is just a part of the very large Spring ecosystem.
For the Inversion of Control (Dependency Injection) paradigm that Spring often is associated with, I find Guice way more awesome.
精彩评论