MVC for Java Desktop App - java

I want to create a desktop application using Java, but I'm new to desktop development and Swing. From web development I know I have to apply MVC to my project. Are there any tools or frameworks that simplify this task? Because I am a web developer I know such tools and frameworks exist for PHP. Are there any books that explain how to structure my project? My IDE of choice is Eclipse. So far I found this article http://www.oracle.com/technetwork/articles/javase/mvc-136693.html

Java Swing components are already the "V" and "C" of the MVC approach. You have to add the models part. In fifteen years of Java I have never found any tools that are better than knowing the Swing components back-to-front. The Swing tutorials from Oracle are the best free way to start.

The Eclipse Rich Client client platform (RCP). This PDF(http://wiki.eclipse.org/images/6/61/Frank_Gerhardt_Eclipse_Data_Binding.pdf) has a complete overview of applying MVC in RCP.
I know I read about people using the Spring framework for rich desktop applications. The Spring Rich Client Project (Spring-RCP) hasn't been updated since 2009, so I'm not sure how many people are doing this with Spring.

Griffon ( http://griffon.codehaus.org/ ) is a framework specifically built to make desktop MVC easy to do. It's in Groovy, a dynamic, Ruby-like language built on the JVM, in which you typically write code in Groovy, but can also mix in Java code.
You can see an introduction with an example that I posted on my employer's blog at http://blog.chariotsolutions.com/2010/12/painless-java-desktop-application.html

Related

Java Web Framework similar with Ruby on Rails paradigm

in your opinion, what is java web framework that most close to or similar to the paradigm of the Ruby on Rails (like convention over configuration, DRY, noXML, etc), but without the need to learn scripting languages ​​like Groovy. And of course have a great documentation and community.
Take a look at Grails which follows the paradigms of Ruby on Rails.
You can take a look to Play Framework it follow MVC and RESTful architectures.
Maybe too late, but have looked at Spring Roo?
This question is a bit old, but this information may still be useful for people looking for a good java framework:
Try ninja framework (http://www.ninjaframework.org). I have tried various java web frameworks and this one was by far the easiest to setup and use. Just follow the tutorial on their page.
Developing with it is very easy, ninja web projects are standard Maven projects so you can open them with any ide that supports Maven. For example, you can open the project with Netbeans, and have the development server running in a commandprompt/terminal window. Any time you save your changes the development server will pickup your changes and restart very quickly.
Or you can use a standard text editor if you want.
Very comfortable to develop with. You can also debug very easily from Netbeans (http://www.ninjaframework.org/documentation/debugging.html)
Note: if you use an ide like netbeans, you dont actually run the project from netbeans, you just edit your changes on the ide and save. The development server picks up the changes automatically.
I think Stripes is what you are after.
http://www.stripesframework.org/display/stripes/Home
You can also take a look at Java on Rails
http://www.javaonrails.net/

From .Net Webdevelopment to Java Web Development

At my work I'm using C#, Microsoft SQL Server, Windows Server and Microsoft Visual Studio. As you can see I'm totally in the Microsoft world.
But i want to broaden my development knowledge and start with java again. I had java classes at school, but my first development job was in .Net VB and till then I'm stuck in the .Net world. It's not that I don't like .Net. I love Visual Studio in combination with R#, and the SQL Management Studio is also very easy to use and very comfortable.
I have good knowledge of ASP.Net Webforms and started with the release of ASP.NET MVC 2 creating intranet applications using this platform.
I want to create small web applications at home with java and want to know, what tools you, as an experienced java developer, can recommend me.
For the IDE: I've used eclipse in version 3 i think and it was around 2004. Is it still a good free IDE or are there now some better ones? Or would you recommend NetBeans or the community edition of IntelliJ for web development?
Is the equivalent of Asp.Net MVC the Spring Framework in Java?
What else do I have to look for, for a smooth switch from java to .net?
Thanks in advance to everybody...
I would go with Intellij, but that is a personal preference.
As for Spring, it definitely is a useful tool to have in your back pocket or on your resume. It provides most of the stack you'll need to develop an application. The biggest missing part is persistence. It interacts with all the popular persistence frameworks out there, Hibernate being the one I would use, so that isn't really an issue.
If you don't like the Spring web framework, you can with others like Struts2. You can use Struts2 with Spring instead of their own MVC framework. Also, there's Guice, which is a dependency injection framework like Spring, which I like better than Spring.
There's also the Play! framework, which attempts to be a full stack like Rails. I've only looked at it briefly so I don't know too much about it. It looks good, though.
Just my 2 cents.

Route to study Java EE and associated technology?

I am an undergraduate student with knowledge of core Java. I want to learn Java EE and related technology for my final year major project and career prospect. what are the Prerequisites for Java EE?
I and my friend have done some research on this matter. We found that we need to know about Servlets, JSP, Javabeans, RMI, etc. We have basic knowledge about these topics. Can we start learning Java EE?
We also found that using framework like Struts or Spring etc will have additional advantage to our software. As per my opinion I should use lightweight framework instead of enterprise framework like spring. can we use these framework in small projects? If no, then what is a better approach/framework?
Our project is a collaboration software for managing code development for open source software development.Project is of Distributed nature.
what are the Prerequisites for java EE??
Strong knowledge of Java SE, especially JDBC. Good object-oriented design and programming skills.
can we start learning java ee ?
Of course.
As per my opinion i should use
lightweight framework instead of
ENTERPRISE framework like spring.
I don't know what "lightweight" means to you, but Spring was created as a lightweight alternative to EJB 2.0. You can certainly start learning Spring, but perhaps you'll appreciate it more after you've done at least one web project without it.
I don't recommend Struts. I think it's an older technology - the first web MVC framework - that's been bypassed by others. I'd recommend Spring MVC or Wicket over Struts. If you want to stick with the Java EE standard, try Java Server Faces.
can we use these framework in small projects?
You can use Spring in any sized project. You don't even have to write the entire project using Spring to gain advantage from it.
if no then what is a better
approach/framework?
Start without any framework. Servlets, JSPs using JSTL (no scriptlets) and JDBC are sufficient to start.
our project is a collaboration
software for managing code development
for open source software
development.Project is of Distributed
nature.
Collaboration and management of projects have nothing at all to do with your choice of language or framework.
Is the application distributed, the developers, or both? Choice of language or framework have almost nothing to do with it.
Yes. The official Oracle tutorial is at http://download.oracle.com/javaee/6/tutorial/doc/
I would suggest that you initially keep it as simple as you can. Java EE is big enough that doing a project just with core technologies will keep you quite busy.
I would suggest you learn Ruby + RubyOnRails. It's far more easier and productive than any Java framework you can get. The advantage of this approach would be: you'll have one more powerful mainstream language in your arsenal, and you'd also learn a very powerful web framework which is considered a state-of-the-art framework in the web world.
If you are interested in following this approach, retag your question with ruby-on-rails to receive valuable inputs from other Rubyists.
Hope that helps,
Aai Zhavli.

Rails for Java Desktop MVC

I'm looking for a desktop application framework similar to Rails/Django but for Java desktop GUI's:
Good ORM (xml, db, whatever)
MVC
Default directory structure
View Helpers / CRUD support
Open Source & Mature
Basically, I want to define a large number of models for a desktop application either in Java or schemas and have a simplistic GUI framework generated to begin extending.
Does anything out there do this or come close?
Thanks.
You might try looking at Griffon: http://griffon.codehaus.org/. It's an MVC framework using the Groovy scripting language.
How about Monkeybars? It's a nice JRuby MVC framework (somewhat inspired by Rails, I think) that runs on top of Swing; you can use any ORM you like with it. I've had a lot of luck with it.
I was using Swinger for testing, but according to http://jeffkreeftmeijer.com/2011/capybara-ate-swinger/ , I think Capybara will now drive Swing apps.
While it isn't quite spot on, have you looked at grails (http://grails.org)?
You can take a look at scala. If you prefer Ruby, then you might try JRuby.
Today, Web applications run smoothly just like desktop apps using ajax. Ext js is a good example.

From Java GUI to Java Web

I've been doing quite large application recently with Java - Swing. Now I'd like to move to web. Basically - I am not Microsoft guy, Java is fine with me. I've checked some basics of Java EE framework and decided that my choice will be Spring. I already am familiar with JDBC. Learning Spring is one thing, but working just with GUIs (C++ and Java) means that I have very poor knowledge of web development.
Before I start reading tutorials of Spring MVC, what should I know to develop web solutions? I am mainly interested "how to" with graphics ... start from scratch or some nice IDE RAD-like development ? I kind of like f.e. Silverlight and integrating to web or asp.net win forms - allows us 'GUI' people develop faster. So can you please give me some useful advices?
Thanx
You might want to check http://code.google.com/webtoolkit/ for some client-side GUI javascript code compilationn from Java language. The code might even look like Swing in a way :)
Another thing of note is, perhaps you might want to use something like Hibernate with Spring instead of using JDBC.
In web, the GUI is mainly done by CSS. You can find here a quick CSS tutorial/reference. You get here some ideas of the capabilities of CSS. The "raw" UI part is done by plain HTML, which are in case of a Java EE webapplication usually served up from good old JSP files or in case of JSF, Sun's own MVC framework, also from XHTML files, powered by Facelets.
Talking about JSF, there exist several rich UI component libraries which can be used on top of JSF, such as RichFaces (showcase here) and IceFaces (showcase here). With those libraries you don't need to pull the hairs out to do the CSS based look'n'feel work.
Spring MVC doesn't offer any rich UI component libraries like that. Spring is in my honest opinion also obsolete in the improved Java EE 6 API which (finally) offers many Spring-like facilities out of the box.
Before you start learning Spring, consider Grails. It is built on top of Spring and Hibernate and it is much easier to learn and use. Grails use Groovy, but if you know java, learning groovy is very fast. Developing Java EE or Spring apps is just too painful and boring. And you can use grails with NetBeans or Eclipse.

Categories