Java Application Architecture


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Java Application Architecture

  1. #1
    Dan Guest

    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

  2. #2
    Mark Guest

    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



  3. #3
    Dan Guest

    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
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center