Moving from class diagram to dialog box

I have a class diagram ("Client") with some private and public attributes as well as some operations. Now I want to simulate a dialog (GUI) for editing this client. The window represents the Customer class and some of the dropdowns and checkboxes represent attributes. Operations ("save", "update") are represented by buttons.

Design Question: Am I designing my GUI dialog to only edit public attributes, or to edit private attributes?

(This is a purely object oriented design question, no implementation.)

+2


a source to share


2 answers


The GUI should only interact with the class using public methods , not attributes and never private members.



It is generally a good idea to separate the GUI from the model. The Model-View-Controller design pattern is a common, tried-and-true approach.

+1


a source


If we apply the concept of "encapsulation", the user interface should only care about public properties (better if they have accessor methods).



+1


a source







All Articles