What is the sense of "Feature Oriented Programming" (FOP) in C++, and would it make sense in Java an
- by ivan_ivanovich_ivanoff
Hello!
Sadly, I can't remember where I read it, but...
...in C++ you can derive a class from a template parameter.
Im pretty sure it was called
Feature Oriented Programming (FOP) and meant to be somehow useful.
It was something like:
template <class T>
class my_class : T {
// some very useful stuff goes here ;)
}
My questions about this:
What is the sense of such pattern?
Since this it not possible in Java / C#, how this pattern
is achieved in these languages?
Can it be expected to be implemented in Java / C# one day?
(Well, first Java would need to get rid of type erasure)
EDIT:
I'm really not talking about generics in Java / C#
(where you can't derive a class from a generic type parameter)