-
Java Application Architecture
Hi,
I want to create a small java application with a GUI (Swing). I have it working
in a rough form in the DOS window. Now I want to "GUI-ize" it.
I just don't know how to go about the architecture side. I have the main
class with the "main" method. In the constructor, I build up the GUI.
Is it better to create an own class for the GUI, and on for the actions/events.
If yes, does anyone have a small example they could give me? I am struggling.
I would in the end just like to add my classes that are running already (DOS
window) and make them react to the GUI. It can't really be that complicated,
can it?
Thanx a bunch
Dan
-
Re: Java Application Architecture
Dan,
Typically, you should separate the 'UI' (GUI, DOS, another application,
etc) from the data and also have a class the controls the interaction between
the UI and the data. This is known as MVC (Model/View/Controller).
This may take a little longer to code, but is worth it in the long run.
Coding in an OO language with OO techniques pretty much guarantees you will
be refactoring. So don't worry if you don't get it right the first time.
Refactoring is much better than having to throw applications away or duplicating
code.
Here is a link to a very good Java person's articles. http://www.javadude.com/articles/index.html
Check out the "Layering Applications" and MVC articles.
Mark
"Dan" <ldfriedli@bluewin.ch> wrote:
>
>Hi,
>
>I want to create a small java application with a GUI (Swing). I have it
working
>in a rough form in the DOS window. Now I want to "GUI-ize" it.
>
>I just don't know how to go about the architecture side. I have the main
>class with the "main" method. In the constructor, I build up the GUI.
>
>Is it better to create an own class for the GUI, and on for the actions/events.
>If yes, does anyone have a small example they could give me? I am struggling.
>I would in the end just like to add my classes that are running already
(DOS
>window) and make them react to the GUI. It can't really be that complicated,
>can it?
>
>Thanx a bunch
>
>Dan
-
Re: Java Application Architecture
Thanx a bunch - appreciate your help! Looking at the article just now!
Dan
"Mark" <mnuttall@ns.com> wrote:
>
>Dan,
> Typically, you should separate the 'UI' (GUI, DOS, another application,
>etc) from the data and also have a class the controls the interaction between
>the UI and the data. This is known as MVC (Model/View/Controller).
>This may take a little longer to code, but is worth it in the long run.
>Coding in an OO language with OO techniques pretty much guarantees you will
>be refactoring. So don't worry if you don't get it right the first time.
> Refactoring is much better than having to throw applications away or duplicating
>code.
>
>Here is a link to a very good Java person's articles. http://www.javadude.com/articles/index.html
> Check out the "Layering Applications" and MVC articles.
>
>
>Mark
>
>
>"Dan" <ldfriedli@bluewin.ch> wrote:
>>
>>Hi,
>>
>>I want to create a small java application with a GUI (Swing). I have it
>working
>>in a rough form in the DOS window. Now I want to "GUI-ize" it.
>>
>>I just don't know how to go about the architecture side. I have the main
>>class with the "main" method. In the constructor, I build up the GUI.
>>
>>Is it better to create an own class for the GUI, and on for the actions/events.
>>If yes, does anyone have a small example they could give me? I am struggling.
>>I would in the end just like to add my classes that are running already
>(DOS
>>window) and make them react to the GUI. It can't really be that complicated,
>>can it?
>>
>>Thanx a bunch
>>
>>Dan
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks