Hi
I was trying to create a code example for a (as I imagine) useful
pattern I would like to call "friend pattern". The name of the pattern is inspired by the C++ "friend" keyword.
Imagine you have a bunch of classes that stores some data, each with different properties and you would like to create a editor (friend) for each of these classes. Of course, these classes has no business of knowing how they can be edited and we would like to define separate classes to edit them. The pattern I called "friend" pattern provides a way other programmers to add their own data classes and editors without having to rebuild any existing component.
I tried to use generics in my example code as much as possible but when I write the last two line I realized I am stuck. I didn't think this through and the last two line won't compile. I realized I might have to change quite a bit of code and remove some of the generics usage. I would really hate that because I find
java's generic very self-documenting and make my idea easy to read and understand.
Can someone help me to make minimum number of changes and make the code compile?
thanks