# CR java kernel implementation: DvEncapsulated **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2006-04-28 13:02 UTC **Views:** 2 **Replies:** 2 **URL:** https://discourse.openehr.org/t/cr-java-kernel-implementation-dvencapsulated/12091 --- ## Post #1 by @babisr 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 --- ## Post #2 by @thomas.beale 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 --- ## Post #3 by @thomas.beale As this is an implementation question, I have replied in the openehr\-implementers list\. \- thomas beale --- **Canonical:** https://discourse.openehr.org/t/cr-java-kernel-implementation-dvencapsulated/12091 **Original content:** https://discourse.openehr.org/t/cr-java-kernel-implementation-dvencapsulated/12091