(j3.2006) I think this is possible, but....

Damian Rouson damian
Tue Jan 23 17:19:37 EST 2018


=

On January 23, 2018 at 2:07:39 PM, Clune, Thomas L. (GSFC-6101) (thomas.l.clune at nasa.gov) wrote:

Van,?

Note - I?ve not read this carefully, but this my immediate response is that this is _not_ something you should be able to do with type extension.?
Yes and no. ?I wouldn?t recommend type extension in the manner described in the original email, but I wonder whether it?s a case in which the component itself should be polymorphic and a setter subroutine can be invoked to establish the dynamic type, thereby allowing the information that the component stores to vary as the component?s dynamic type varies.

Instead, it appears to be a classic example of the need for generic programming.?
or possibly a classic setting in which object-oriented design patterns would be useful. ?My recommendation above is essentially an example of the State pattern. ?In a paper we published in Scientific Programming, Salvatore and I applied the State pattern to allow the storage format used in a sparse-matrix library to vary at runtime based on the problem and hardware available. ?See?https://www.hindawi.com/journals/sp/2014/469753/abs/.



Damian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.j3-fortran.org/pipermail/j3/attachments/20180123/6faa89bd/attachment-0003.html>



More information about the J3 mailing list