From: Tripp, B. <Bry...@uh...> - 2001-12-14 16:40:43
|
Hi Abe, Excellent advice, as always. We could use something similar to clone(), except that it wouldn't create a new object (so it would be copy(Object) : void, instead of clone() : Object). On the other hand why not define type-specific copy methods for Message, Segment, and Type? Would we want to copy anything else? You could define, for example, Segment.copyInto(Segment otherSegment) and then implement it in AbstractSegment. I guess it's a trade-off between genericness and type checking (?). The only annoying thing is that if somebody had a Segment that didn't inherit from AbstractSegment, they could have to implement copyInto again. But this would be a small percentage of the total work, and they could always cut and paste. Bryan -----Original Message----- From: Abraham Tio [mailto:ti...@ta...] Sent: Friday, December 14, 2001 10:09 AM To: 'Abraham Tio'; 'Glock'; hl7...@li... Subject: RE: [HAPI-devel] deep copy functionality In further thought, how about an interface for all things copiable ? Or add an abstract method to the base class common to all classes ? Abraham Tio MD, Chief Technologist Tacteon LTD. http://www.tacteonltd.com -----Original Message----- From: hl7...@li... [mailto:hl7...@li...] On Behalf Of Abraham Tio Sent: Friday, December 14, 2001 10:00 AM To: 'Glock'; hl7...@li... Subject: RE: [HAPI-devel] deep copy functionality I would do both, and use the implementation as a pattern for copying just about everything else that needs to be copied. Today we're thinking about deep copy for the purposes of echoing segments and messages. Tomorrow, who knows why we'll be copying. Much like the clone() method in many java class interfaces, the uses are varied and many. Does the pretense of the clone() method apply to hl7 message components ? Abraham Tio MD, Chief Technologist Tacteon LTD. http://www.tacteonltd.com -----Original Message----- From: hl7...@li... [mailto:hl7...@li...] On Behalf Of Glock Sent: Friday, December 14, 2001 8:02 AM To: hl7...@li... Subject: [HAPI-devel] deep copy functionality All: I'm working on the deep copy functionality (task 42332) and am seeking feedback on where this should be implemented. I'm leaning toward making it part of the Message interface since it must act on an entire segment in addition to select fields. Another option is to simply view the segment as comprised of "all fields" and make it part of Segment interface. Thanks, John Glock-- _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel ???????????????????????????????????????????????????????????????????????? ???????????????????????????????????????????????????????????????????????? ?????? _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel _______________________________________________ Hl7api-devel mailing list Hl7...@li... https://lists.sourceforge.net/lists/listinfo/hl7api-devel |