4 Replies Latest reply on Mar 24, 2010 2:19 PM by 800387

    Simple GUI pattern - having trouble finding one !

      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
        • 1. Re: Simple GUI pattern - having trouble finding one !
          Don't be obsessed with "patterns".
          • 2. Re: Simple GUI pattern - having trouble finding one !
            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 !
              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 !
                About as much as you can simplify things without spaghetti code: [http://c2.com/cgi/wiki?ModelDelegate]

                - Saish