I have an abstract class called Node. It contains a constructor that takes a string from my database and creates basic information. All pieces of content on my site extend this class - Person, Event, Projectetc.
The 3 of these expandable classes are special - when they are created, in addition to pulling values from the database, they must also request a web service; if the web service provides values other than the values given in the database, they must be stored in the database.
In a language with multiple inheritance, this will be quite simple; any of these classes will extend both Node, and so APIData, or something like that. Without IM, I'm not sure how to handle this. Using an interface would not help, as it does not provide concrete implementations.
A decorator sample is sometimes recommended as a replacement for some IM functions, but I have not enough experience to determine if this is a suitable choice. Any suggestions?
source
share