Frank,

I just wanted to thank you for your input regarding these design issues. It gives us an opportunity to review our design choice further and verify it still applies to current user situations and needs. Please let us know if you have any needs that are not being met by the current design.

Cheers,
Mark

Mark R. Diggory wrote:

F Norin wrote:

Yes you're right, with the parametrization model you're using it would probably be confusing to simply let the exponential and chisquared distributions be instances of a gammadistribution. However, this indicates that there may be something flawed here. Remember, the chisquared distribution *is a* gammadistribution, and this should be reflected in the inheritance structure. Basically, you need some means to express relationships between probability distributions.


Inheritance is not necessarily the best (or only) way to model such a relationship, adapters and wrappers are a very prevalent design pattern.

Java inheritance (single inheritance) is a poor choice for describing relationships such as this because the relationship between Gamma and ChiSquare is a "restriction of capability" not an "extension of capability". Yes, we could use inheritance and override the setBeta method to block its usage, but this violates all kinds of Interface/Implementation and expected behavior design rules too.

Is there a reason you need to have ChiSquare and Exponential extend Gamma instead of wrapping it or using an alternate efficient implementation?

-Mark

-- Mark Diggory Software Developer Harvard MIT Data Center http://www.hmdc.harvard.edu

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to