Regarding Interfaces
Posted: Wed Sep 23, 2009 3:38 pm
I've been looking at the interfaces in Jade with a view to removing some of the code duplication (effectively the same methods on two or more classes) and wondering if they could be made more flexible. Specifically whether the interfaces could
I'm wondering if it would be useful to put the calculation method on an interface and then map Get methods on the interface to the underlying data in the persistent and transient structures (obviously the transient and persistent structure would need to be similar.)
An interface used to calculate interest on a mortage may have the following Get methods mapped to the data
- Allow methods on the interface to be mapped to properties on real classes (effectively a Get method)
- Allow methods to be written on the interface (rather than just mapping to existing methods on real classes)
I'm wondering if it would be useful to put the calculation method on an interface and then map Get methods on the interface to the underlying data in the persistent and transient structures (obviously the transient and persistent structure would need to be similar.)
An interface used to calculate interest on a mortage may have the following Get methods mapped to the data
- getTerm
- getInterestRate
- getPrinciple