Code: Select all
/MyLibrary
/Component
Alarm.php
Calendar.php
Event.php
Todo.php
Entry.php
/Property
Method.php
Version.php
ProdId.php
Start.php
End.php
Description.php
Summary.php
Title.php
So you can see how sometimes the specifications for required properties/components can be either very straightforward or somewhat complex. At first I was just going to add a $requiredProperties property on the component class, but after finding out that the specifications for when properties are required can be much more complex than I first thought, it became clear that I needed something a little more complex to define required properties. I have been looking at my Gang of Four design patterns book and the only design pattern I have found that seems even somewhat close to what I need is the decorator pattern. Can anybody think of a good way to define which properties are required and when? I am really struggling with this...