Search:

Type: Posts; User: Fubarable

Search: Search took 0.16 seconds.

  1. Replies
    11
    Views
    4,101

    Re: Should GUI Panels be Singletons?

    OK, but the data itself will be held by the model. The GUI only provides a view to the data and nothing more.



    No. It needs access to the model via the control. Again, the JPanels above only...
  2. Replies
    11
    Views
    4,101

    Re: Should GUI Panels be Singletons?

    Below is another example uploaded as a .zip file although in reality it's a runnable .jar file:

    1437

    A single file example of it is posted below:



    import java.awt.*;
    import...
  3. Replies
    11
    Views
    4,101

    Re: Should GUI Panels be Singletons?

    You have only one model object, and as mentioned by copeg above, you hook it up to the view object via the control. If set up well, this can often be done with just a few lines of code in the main...
  4. Replies
    11
    Views
    4,101

    Re: Should GUI Panels be Singletons?

    You have the usual problems that people complain about with singletons -- risk of tight coupling, difficulty in mocking, difficulty in testing, risk of more than one instance if more than one class...
Results 1 to 4 of 4