Skip to content

Latest commit

 

History

History
14 lines (9 loc) · 675 Bytes

236b.md

File metadata and controls

14 lines (9 loc) · 675 Bytes

Back to questions

Solution to 236b: Fields for properties

See code at solutions/code/tutorialquestions/question236b

The key point here is that all of these fields are relevant to all types of property, thus they should belong in the abstract Property superclass. If you used a Property interface, rather than an abstract class, then you may need to adapt your design a bit to allow these fields to be represented at an abstract level.

In the sample solution I have simply redefined Property, providing it with the new fields with protected visibility (so that these fields are visible to subclasses of Property).