The Artima Developer Community
Sponsored Link

Design Forum
Object Orientation Desgin

1 reply on 1 page. Most recent reply: Nov 16, 2004 5:58 AM by Anders Grusell

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Emilie

Posts: 1
Nickname: emilie81
Registered: Oct, 2004

Object Orientation Desgin Posted: Oct 26, 2004 12:15 PM
Reply to this message Reply
Advertisement
Here is my question:

I have a class (a Frame) within which there are many other classes (classes that extend JPanel). The relationship between the Frame and its constituent panels is evidently an aggregation. Now, there are plenty of variables that the Frame and its panels need to access (say, var1,var2 and var3). The panels have to access these variables upon repaint. The Frame has to access the same set of variables for other purposes (like when it needs to output a report that has the values of the variables).

Where should I put these variables ? Should I include them in the declaration part of the Frame as private variables? Should I create a new class and have the variales be instance variables of that class, and what would be the relationship between this very class and the other classes (i.e. the Frame and it's constituents panels) ?


Anders Grusell

Posts: 1
Nickname: frost
Registered: Nov, 2004

Re: Object Orientation Desgin Posted: Nov 16, 2004 5:58 AM
Reply to this message Reply
A good idea may be to take a look at the "Model-View-Controller" design pattern.

Flat View: This topic has 1 reply on 1 page
Topic: What's big deal about { Agile xp = new Agile (new XP());} :}} Previous Topic   Next Topic Topic: Estimating Cost Of ASP.NET & VB.NET Projects

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use