Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC for Java Desktop App

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

like image 828
hidarikani Avatar asked Feb 18 '12 15:02

hidarikani


People also ask

Can you use MVC in Java?

Advantages of MVC Architecture in JavaAs components have a low dependency on each other, they are easy to maintain. A model can be reused by multiple views which provides reusability of code. Adoption of MVC makes an application more expressive and easy to understand. Extending and testing of the application becomes ...

Does Java AWT support MVC?

MVC pattern is not supported by AWT.

How MVC is used in Java Swing?

Swing architecture is rooted in the model-view-controller ( MVC) design that dates back to SmallTalk . MVC architecture calls for a visual application to be broken up into three separate parts: A model that represents the data for the application. The view that is the visual representation of that data.

What is a Java MVC?

MVC Pattern stands for Model-View-Controller Pattern. This pattern is used to separate application's concerns. Model - Model represents an object or JAVA POJO carrying data. It can also have logic to update controller if its data changes. View - View represents the visualization of the data that model contains.


2 Answers

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.

like image 64
colbadhombre Avatar answered Nov 01 '22 17:11

colbadhombre


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.

like image 36
mcgyver5 Avatar answered Nov 01 '22 18:11

mcgyver5