Note that there are some explanatory texts on larger screens.

plurals
  1. POAvoid changes propagation
    primarykey
    data
    text
    <p>First of all sorry for my bad English :D Recently I'm studying more deeply Design Patterns because of an exam of Software Engineering and I have to design a software system as a project for this exam.</p> <p>There is a problem that I cannot handle with: how to decouple entity classes (which represents the data of my application domain) from... everything else!</p> <p>I mean, being more concrete, that if I have a class Patient (with its own private attributes and public getter and setter methods), this is an entity class, I think that so far I got it right :D</p> <p>So let's say that I choose to design my program using the MVC pattern architecture, the class Patient will be in the Model, is that correct?</p> <p>Now, every view that deals with that class, will have a reference to it: lets say I have three views: the first one to view all patients, another one to modify a patient, and the last one to register a new patient (actually there will be other classes in which I should present some reports, but I think this is irrelevant now).</p> <p>Each one of these classes will know the structure of Patient in order to show its data, e.g. they will call its getter methods and show the data in some way.</p> <p>I think that there is no way to avoid this, since a view is semantically tied to the data (=model) it has to show: I mean that it has to know whether a data is a string, a date or an integer and it has to know also its semantics (what it represents in the real world); so I think that doesn't make much sense just removing references to the class Patient.</p> <p>Now the heart of the problem is: How to prevent that a change in the class Patient propagates to all classes (not only views) that uses it?</p> <p>I mean: let's say that the attribute String Cellular changes in String[] Cellular because of a change in the requirements. I will have to modify: 1) DB / DB interfaces 2) Patient class 3) (worst of all) every class that uses Patient!!</p> <p>How to avoid this? I think that in a good project a change in a single class should not propagate in a chain of changes to all modules that uses that class, but I'm a beginner and I can't think of a way to prevent this.</p> <p>I can't even think of a good way to use a stable interface for entity classes, since a change in the requirements will reflect in a change to the interfaces (and I don't think that interfaces are meant to be changed!).</p> <p>Please help!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload