Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Some years ago I started "studying" and working with JAVA (I gotta say that I am an embedded developer, so I mostly work in C and C++).
Receptly I have started working with Databases so I stumbled on Hibernate. I read couple of starting guides and books about the topic and started to play around with some small projects.
Surfing on the Internet (Stackoverflow included) I only have seen projects that include Hibernate/JPA + Spring [+ Struts].
I am designing a quite big personal project. I wanted to do it "step by step" in order to learn all parts that it implies: DB, Hibernate (I wanted to use first hbm.xml and then Annotations), make an easy standalone swing application, and then use Spring + web page.
Probably my question is a little stupid but, I will ask it anyway
Does Hibernate make sense without Spring?
Should I keep playing a little longer with Hibernate while I read up on Spring and then develope the project using both technologies?
My only goal in this project is to learn. Nothing more, nothing less. I do not care about the effort.
Thanks so much for your opinions! I appreciate!
Yes Hibernate make sense without Spring but it will make more sense with Spring :)
As you have already studied Hibernate, you know about it so let me tell you that Spring will make your life more easier mainly because of DI and it also have Hibernate support classes for doing common functions, transaction management.
I suggest you to do both together because without Spring you will be learning obsolete Hibernate Design, for example using Service Locator etc.
Note : You will find learning Spring way much easier as compared to Hibernate :)
Unless you have a pressing reason to do your database work first, I would suggest taking a different approach and learning Spring core before you dive into Hibernate. This is what I did way back when I learned both, and it was very effective for me.
As another answer mentions, Spring is (probably) easier to learn than Hibernate, and you will probably end up with a "cleaner" project as a result of using Spring since using the framework encourages the use of a lot of best practices in Java. Since you're learning Java, that's a big plus.
Once you get those practices down, you can move into Spring/Hibernate integration and tackle that, but you'll probably find it a lot easier.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
When I started to learn a Spring Faramework I focused my attention on specific details but not on clue and global concepts. Actually I can't grasp some of Spring framework goals.
May be this question too wide, but I don't see any sense to divide it into few separate questions. I don't expect that you answer all my question, but at least one of them.
Spring framework goals:
Make J2EE easier to use
Address end-to-end requirements rather than one tier
Eliminate need for middle tier “glue”
Provide the best Inversion of Control solution
Provide a pure Java AOP implementation, focused on solving common problems in J2EE
Fully portable across application servers
“Non-invasive” framework
Facilitate unit testing
Facilitate OO best practice
Provide a good alternative to EJB for many applications
Enhance productivity compared to “traditional” J2EE approaches
Questions:
1). Easier to use? By mean of what? And comparing with whom? It seems for me that comparing with pure J2EE each framework provide ease of use. Please more details and examples.
2). Don't understand this point. What is end-to-end requirements?
3). Don't understand this point.
6). Does it mean that another Spring alternatives isn't portable via app servers? Isn't EJB portable?
9). Isn't it the same as 4th point.
11). Please some examples of that non-productive J2EE approaches.
You can go through below links to know more :
spring forum
spring-3-0-vs-java-ee-6-0
Spring vs Java EE
Why Java EE Lost and Spring Won
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I am trying study web development using Java but its seems very intimidating. all the tutorials are showing very complex methods, even the sample applications that came with NetBeans. I have some experience working with PHP but none with java.
Is there any simple way to use java on the server to just accept post requests and save to database and then display data from database without using things like javaServer faces?
Is it necessary to use frameworks like spring?
Pls forgive if i am asking stupid questions. i cant seem to find where to start learning from and tutorials seem too confusing.
Links to any good article will be very helpful
Thanks
For this purpose you should be familiar with the Servlet API, and preferably also with MVC frameworks and so on.
For the whole world to be a bit more straightforward for you and to steer away from the average-PHP-community-drawbacks (e.g. nobody tells you how to code well), I'd recommend to read THIS book.
But first of all, start HERE and then move on to THIS SITE.
The other way around (talking about DB access, not the web service here) is using raw SQL via JDBC which I won't recommend unless you have a good reason for it and you're already familiar with using a DB the right way (mysql and mysqli libs of PHP won't necessarily drive you the right path; PDO most probably will however).
Of course you don't necessarily need to use frameworks, but you're (actually in any language) way better off using them. Yes, probably the closest thing to the "nobrainers-php-methodology" (mindless coding; wiring UI, DB access and business logic together in a single file; etc.) is using the Servlet API, and then through a java.sql.Connection send your GET/POST data directly to the DB via JDBC. But doing so is slightly worse than cruelly murdering cute little squirrels/bunnies/kitties/insert_your_favourite_cute_creature_here
You'll also need a servlet container, most common of which is Apache Tomcat.
To learn Web Developing with Java Play Framework 1 is very nice:
Step by Step guide for a cool blog: http://www.playframework.com/documentation/1.2.7/guide1
Documentation: http://www.playframework.com/documentation/1.2.7/home
CRUD module documentation: http://www.playframework.com/documentation/1.2.7/crud
You get compile feedback directly in the browser.
Run your tests in the browser.
No redeployment to containers necessary/hot deployment.
No servlets.
Play 2 is already around, but going through Play 1 is much simpler if you are new a the Java world.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I have the first meeting with my project manager and she assigned me a project which to be start soon. She explained to me few points related project e.g. technology, functionality, end user expectation etc.
MVC based web application
Not to use any framework
Server Side : use only Java, servlet, jsp
UI : Javascript, jQuery can also be used
integratation with existing project (at later stage)
There is one point i can not understand why she asked me to not to use any framework although i could not ask why. Does anybody clarify ? If i use any framework like spring then will it create any problem while integration with existing project.
I can recognize 2 sub questions in your question.
In what scenario the framework should not be used?
why she asked me to not to use any framework?
Answer 1
I can imagine situation when you don't need any framework. It is if you have to create extremely simple 1-2 screen application without any security, access rules and probably without DB based persistence. This means that IMHO framework-less application is good as a student exercise just to understand how things work.
Answer 2
She is ... not professional enough. I am sorry to say it but this is pretty obvious. To implement MVC without framework you have to perform a lot of dirty work. I believe that the key reason for this strange requirement is "integratation with existing project" that is probably created without any framework, so PM thinks that framework could bother you during this integration.
Moreover, product manager should never dictate R&D how to implement project. Project manager can politely ask to implement certain set of features.
I am sorry if my answer is helpful.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I know this question is subjective but I would really want to know what are the best j2ee web application auto code generators.
I googled and found out the Appfuse is one of them.
Spring ROO is another but it depends on spring i think.
Are there any other better tools?
Basically lot of time is spent on creating regular CRUD screens with the same mundane things for each screen.
So, I would want to reduce the time spent on such simple CRUD screens so that I can focus more on the core application logic.
We use Telosys (http://www.telosys.org/) to generate repetitive code like CRUD screens.
A set of templates are available for Spring MVC, JPA, AngularJS, etc.
We have customized some of them. It saves of lot of time.
The best solution I have seen so far is Grails. It generates groovy code, not java but you can interface painlessly with any java library/class. The convention over configuration features are amazing and one can put up a functioning web app in minutes. I suggest you see for yourself - just try the grails screencasts. They will get you up to speed in 15 minutes.The technologies used under the hood are best-of-breed : spring, hibernate, lucene, quartz, sitemesh etc.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
In the last time I heard a lot of complaining about Hibernate. And indeed I have some painful experiences with Hibernate too. So I read about Ebean and Siena.
Both have interesting approaches. Unfortunately, database access layers are very easy to write, but if your project grows and you have to handle great database-tables, you know if they are good or not. So it's really difficult to evaluate such a tool. Hibernate is well known and you could be sure that you can solve your problem with it. Sometime you need to learn a lot, but you can solve it.
How is it with Ebean? Are there any real world applications? Which databases are supported? Is it reliable?
After searching a little bit more I see that there are a lot more ORM-frameworks, so is there at least one reliable one?
Rob (Ebean Committer) here.
Ebean is about 4+ years old now. I would say it is fairly mature now. The supported DB's include Oracle, MySql, Postgres, H2 and SQL Server (and recently SQLite). Ebean is doing stuff that other ORM's are not such as Autofetch (automatic query tuning) so I'm not how that fit's into a 'maturity rating'. IMO the Ebean community is relatively small though so you probably need to hit the Ebean google group to engage them.
Any real world applications? Yes, but you are best to ask the Ebean community about that really. Certainly there is good support for batch processing (batch size, turn of cascading persist for a transaction etc) and large query support that I don't see in JPA etc (you might get something similar with Hibernate's Sessionless support).
Hopefully this might answer some small parts of your question anyway.
Cheers, Rob.
I'm currently a developer of Siena but not since very long. Let me explain why I became a developer on this project?
I went to Siena because I wanted to use Play+GAE and Siena appeared to be a good start for GAE DB and I really wanted to avoid JDO/JPA.
Then, I began to really appreciate Siena for its straightforward, light and easy approach and so simple APIs. It doesn't pretend to be the all-in-one abstraction layer like JDO and the greatest standard DB API like JPA. It really made me think of DB APIs from Python/Ruby and it really fits my point of view: I want a simple DB API which allows me to solve the great majority of my problems and when I have a more complex problem, I will use the lower layer APIs but certainly not an abstraction layer such as hibernate.
The possibility to make my code work on GAE DB or JDBC was also a good aspect. Once again, Siena doesn't pretend to provide exactly the same things in both worlds because SQL and NoSQL are not really compatible (but ORM is neither really compliant to SQL model :) ).
But once again, it is quite practical to be able to rely on the same APIs in several DBs.
Finally, the library is ONE jar and you don't have to retrieve the whole universe to use it.
So, I became progressively a committer on Siena because I wanted to take part of this nice little adventure.
Now siena team is working on a new version keeping the same simple APIs, bringing new interesting features and really improving all the backend code to make it even easier to extend for new DB support.
Siena is a pragmatic API driven by user experiences and that's why I like it ;)
Pascal
We've had really great experience with MyBatis, which is not an ORM per se, but another class of persistence manager, an SQL Mapper. Using it you start with SQL statements and direct it on how to map result rows into POJOs. It's conceptually easy to understand and tune with not much magic going on inside. It's ideal if you are comfortable with SQL or need to work with an established schema.
Besides Ebean and Siena:
You can try JIRM which is focused on CRUDing immutable objects (yes I'm the author).
There is also jOOQ and Joist.
I feel that JIRM minimizes the number of DTO's because the domain objects are immutable and do not inherit, implement and/or are not "enhanced/instrumented". Such is not the same with Siena and Ebean.
Also because the objects are Immutable there is more of a focus on per column updating instead of the whole object which makes more sense given today's AJAX interfaces (compared to the old POST the whole bean model).
What about using EB3, with for instance JBoss (www.jboss.org)?