BackboneJS ToDo list example with Spring 3.1 (no xml config) and MongoDB
github.com
github.com
For more on Backbone here's the official page http://documentcloud.github.com/backbone/
For a non-Java developer, it might either break the myth that Java EE is too much based on XML, or reinforce it. Spring, JAX-RS, JSF etc. now allow no-XML configuration, and they are not as verbose as they used to; but still it might seem daunting for someone outside (I'm also someone from outside in this respect too, I have been doing Java EE only for the last 3 months, (I had Django/Python experience before) and it has been hard to get to learn all the Java EE technologies by myself (e.g. how many ways are there to do DI in Java EE? Spring, CDI, JSF, with or without XML etc.)
Thanks!
1. Maven + Eclipse/IntelliJ
2. JavaEE 6 and Spring 3.1 (note the specific version)
3. Spring Data (previously known as Hades)
4. JUnit or TestNg and Mockito.
5. Findbugs, Checkstyle, Sonar, and Hudson.
You can ignore JSF unless it is the mandate. Sticking with minimum JSP or transmiting JSON works fine regardless your stack of choice.
PS: JavaEE 6 supports dependency injection and a bit of AOP.
Java is great and you can be as productive as you want.
Another thing is that the JVM environment is getting richer every year, with more Frameworks and languages.
As I said before, Java is a work horse. My fun coding is now in Javascript and Scala, but to work, for me nothing beats Java and it's stack.
Or, why is the code at:
spring-backbone-todo/src/main/java/org/resthub/todoThe last part of the path is required by the convention of having a unique/meaningful namespace/package name and the language requirements (not sure if I like that or not, C# doesn't have this - sometimes I love that, sometimes I curse when I search for the file that contains a certain class):
- Namespaces have to correspond to folders.
- File names have to correspond to the (first?) public class declared within.
(From memory, I hope I have no _really_ big flaws in there. Haven't touched Java for quite some time)
This project has a "pom.xml" (Maven configuration file) in it's root directory, so it is using Maven. While you could use alternate folder structures with Maven, that requires configuration, whereas if you use the convention, Maven reads these folders by default. So if you also had a src/test/java folder, Maven would know that your unit tests are in that folder, and would automatically run the tests as part of the build.
The org/resthub/todo part maps directly to the Java package (namespace), which would be "org.resthub.todo". As darklajid said, this is a language requirement.
These deep folder structures can be annoying if you are using a regular file browser, but Java IDEs generally flatten out the packages, so that you see all packages all at once in a list, so you don't have to do a lot of expanding of subdirectories.
'/pom.xml' in root folder
No xml config meaning Spring is configured completely by annotations, as described on the GitHub page:
> "XML free Spring MVC 3.1 backend (no web.xml, no applicationContext.xml)"
pom.xml is used by Maven, and every Maven project must have one https://maven.apache.org/pom.html#What_is_the_POM