The DvEncapsulated class and its subclasses accept at their full constructor the size as an argument.
I believe that the size should be a calculated attribute and not a constructor argument. In my opinion, it is the responsibility of DvParsable and DvMultimedia to calculate the size of their content.
By the way, the xml schema defintion of DV_ENCAPSULATED, correctly does not declare the size attribute, because it should be calculated.
My suggestion is that:
- Remove the size attribute from DvEncapsulated, and declare the getSize(): int method as abstract.
- Let the DvParsable and DvMultimedia implement this method
Haralampos Routis wrote:
The DvEncapsulated class and its subclasses accept at their full constructor the size as an argument.
I believe that the size should be a calculated attribute and not a constructor argument. In my opinion, it is the responsibility of DvParsable and DvMultimedia to calculate the size of their content.
By the way, the xml schema defintion of DV_ENCAPSULATED, correctly does not declare the size attribute, because it should be calculated.
My suggestion is that:
1) Remove the size attribute from DvEncapsulated, and declare the getSize(): int method as abstract.
2) Let the DvParsable and DvMultimedia implement this method
------------------------------------------------------------------------
×ñçóéìïðïéåßôå Yahoo!
ÂáñåèÞêáôå ôá åíï÷ëçôéêÜ ìçíý ìáôá (spam); Ôï Yahoo! Mail äéáèÝôåé ôçí êáëýôåñç äõíáôÞ ðñïóôáóßá êáôÜ ôùí åíï÷ëçôéêþí ìçíõìÜôùí
http://login.yahoo.com/config/mail?.intl=gr
The intention here was that this property is a data attribute, i.e. to get the value (which is likely to be quite a normal query) you shouldn't have to recalculate - it means that you don't even have to get the object off the database to find out how big its multimedia component is.
But I agree that size should not be a parameter to the constructor - it should be calculated by the constructor and then saved to the attribute.
- thomas beale
As this is an implementation question, I have replied in the openehr-implementers list.
- thomas beale