JaroslavTulach at 21:14, 8 May 2012 - 2012-05-08 21:14:55

←Older revision Revision as of 21:14, 8 May 2012
Line 10: Line 10:
</source>
</source>
-
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the other hand, this prevents multiple inheritance for implementors and delegation to other implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
+
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the other hand, this prevents multiple inheritance for implementors and delegation from one implementor to other implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Creational]]
[[Category:APIDesignPatterns:Creational]]

JaroslavTulach at 21:14, 8 May 2012 - 2012-05-08 21:14:32

←Older revision Revision as of 21:14, 8 May 2012
Line 10: Line 10:
</source>
</source>
-
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the other hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
+
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the other hand, this prevents multiple inheritance for implementors and delegation to other implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Creational]]
[[Category:APIDesignPatterns:Creational]]

JaroslavTulach at 21:13, 8 May 2012 - 2012-05-08 21:13:32

←Older revision Revision as of 21:13, 8 May 2012
Line 10: Line 10:
</source>
</source>
-
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the othe[[Category:APIDesignPatterns]]
+
It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the other hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
 +
 
 +
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Creational]]
[[Category:APIDesignPatterns:Creational]]
-
r hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
 

JaroslavTulach at 16:56, 12 April 2009 - 2009-04-12 16:56:03

←Older revision Revision as of 16:56, 12 April 2009
Line 13: Line 13:
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Creational]]
[[Category:APIDesignPatterns:Creational]]
-
r hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClasses]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.
+
r hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClass]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.

JaroslavTulach: New page: Safer variant to ImplementOnlyInterface is to use abstract class with '''protected''' methods. Then it is clear the meaning of such methods is clear again as advocated by [... - 2009-04-12 16:55:19

New page: Safer variant to ImplementOnlyInterface is to use abstract class with '''protected''' methods. Then it is clear the meaning of such methods is clear again as advocated by [...

New page

Safer variant to [[ImplementOnlyInterface]] is to use abstract class with '''protected''' methods. Then it is clear the meaning of such methods is [[Clarity|clear]] again as advocated by [[ClarityOfAccessModifiers]].

The '''NonMixedFactory.Provider''' interface would then become:

<source lang="java">
public abstract class Provider {
protected abstract void initialize(Callback c);
protected abstract int toBeImplementedBySubclass();
}
</source>

It is clear that these '''protected''' method cannot be called by anyone else except the [[API]] infrastructure. On the othe[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Clarity]]
[[Category:APIDesignPatterns:Creational]]
r hand, this prevents multiple inheritance for implementors. Whether to choose the [[ImplementOnlyAbstractClasses]] or [[ImplementOnlyInterface]] is ultimately a matter of personal preference.