Closed mcicolella closed 10 years ago
Can you further explain that? I don't understand this change (besides the unnecessary reformatting). There is never a concrete type Datapoint created, its an abstract class. You basically inline the create factory method, no?
Hi, sorry for delay. I want to store in DatapointMap the correct type of datapoints read from datapoints xml file. So I modified loadXML method to set the subclass type
Datapoint dp = null; // sets the correct datapoint subclass StateDP or CommandDP if (readDPType(r)) { dp = new StateDP(r); } else { dp = new CommandDP(r); }
Using a generic Datapoint I can't read updating addresses of StateDP. Thanks
And how is that different from the create method that is currently used? The created object assigned is always an instance of StateDP or CommandDP. That the declared type is Datapoint doesn't matter.
Again, there is never a Datapoint instantiated directly (it's an abstract class), always subclasses thereof.
You are right. Please close this. Thanks
Modified DatapointMap class to store StateDP and CommandDP instead of a generic Datapoint