This discussion is archived
4 Replies Latest reply: Mar 24, 2010 7:19 AM by 800387 RSS

Simple GUI pattern - having trouble finding one !

843853 Newbie
Currently Being Moderated
Greetings !

I'm desperately trying to find a design to link up my GUI to my DAOs.
The applications I'm designing are quite small, so I'm finding the MVC pattern overly complicated.
I suppose I'm looking for a "cut-down" version of the MVC.

I've looked for many, many hours on "the net", and I'm very surprised I cannot find any thing useful.
I've found a mention of a presentation-document pattern, which was indicated to be for simple GUIs - but I cannot find any
explanation nor examples of this pattern.

PLEASE, please - can someone point me in the right direction for an example of a practical pattern / guide on how to design small GUI applications
that link the presentation to data?

I really appreciate any help anybody can give.


Many thanks
Marc
  • 1. Re: Simple GUI pattern - having trouble finding one !
    jwenting Journeyer
    Currently Being Moderated
    Don't be obsessed with "patterns".
  • 2. Re: Simple GUI pattern - having trouble finding one !
    843853 Newbie
    Currently Being Moderated
    I come from a Delphi / VB background, where the basic application structure has been GUI layer talking directly to the DAOs.
    Recently I've been using Java, and I get the impression the drive is to use patterns "where possible"

    I'm trying not to be "obsessed", but I'm aware there are best practices of linking up GUI aspects with the DAOs.
    That's why I asked for a "practical" solution to the problem, as using MVC just for sake of it - didn't feel right.

    I want to use these small scale utility applications, to learn and explore how to structure better GUI applications in Java.

    I'm just looking for people's experiences, and ideally some examples, in how to go about this ( in small applications - where the MVC is unnecessary).


    Again, any help would be appreciated.
  • 3. Re: Simple GUI pattern - having trouble finding one !
    jwenting Journeyer
    Currently Being Moderated
    What I mean is "don't focus on using a 'pattern' for the sake of using one".
    Separation of concerns is good, but there's no need to straightjacket yourself into something written in some book as being the best way to achieve it.

    Knowing you have a problem is often half the solution, common sense will provide the rest.
    So you want to get separation of concerns but consider a full MVC approach to be overkill.
    Maybe try adding a lightweight layer based on JPA, that would effectively delegate the actual database logic to that while you can still keep the controlling code in the forms (or near them).
  • 4. Re: Simple GUI pattern - having trouble finding one !
    800387 Newbie
    Currently Being Moderated
    About as much as you can simplify things without spaghetti code: [http://c2.com/cgi/wiki?ModelDelegate]

    - Saish