JaroslavTulach at 18:48, 24 September 2020 - 2020-09-24 18:48:51

←Older revision Revision as of 18:48, 24 September 2020
Line 1: Line 1:
[[Image:OpenSpace.png|thumb|right]]
[[Image:OpenSpace.png|thumb|right]]
-
There is a difference between [[ClientAPI]] and [[ProviderAPI]] [[evolution]] rules. As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the the [[API]] can only be called, then the obvious requirement is to add more methods and to allow users to call more of such exposed functionality.
+
There is a difference between [[ClientAPI]] and [[ProviderAPI]] [[evolution]] rules. As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case when the [[API]] can only be called, then the obvious requirement is to add more methods and to allow users to call more of such exposed functionality.
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing elements, don't need to care about the new ones. [[ClientAPI|Clients]] seeking new functionality will be pleased when it gets exposed in the ''open space'' of your [[ClientAPI]].
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing elements, don't need to care about the new ones. [[ClientAPI|Clients]] seeking new functionality will be pleased when it gets exposed in the ''open space'' of your [[ClientAPI]].

JaroslavTulach at 12:34, 21 March 2011 - 2011-03-21 12:34:23

←Older revision Revision as of 12:34, 21 March 2011
Line 1: Line 1:
-
There is a difference between [[ClientAPI]] and [[ProviderAPI]] [[evolution]] rules.
 
-
 
[[Image:OpenSpace.png|thumb|right]]
[[Image:OpenSpace.png|thumb|right]]
-
As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
+
There is a difference between [[ClientAPI]] and [[ProviderAPI]] [[evolution]] rules. As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the the [[API]] can only be called, then the obvious requirement is to add more methods and to allow users to call more of such exposed functionality.
-
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
+
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing elements, don't need to care about the new ones. [[ClientAPI|Clients]] seeking new functionality will be pleased when it gets exposed in the ''open space'' of your [[ClientAPI]].
-
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class (one cannot create binary [[BackwardCompatibility]] problems by adding new methods into such class). Exposing only '''final''' classes to users of [[ClientAPI]] makes it bullet-proof:
+
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class (one cannot cause binary [[BackwardCompatibility]] problems by adding new methods into such class). Exposing only '''final''' classes to users of a [[ClientAPI]] makes it bullet-proof:
<source lang="java">
<source lang="java">
Line 19: Line 17:
</source>
</source>
-
The shape of [[ProviderAPI]] is quite different. Can you imagine the result, when you mix goals of your [[API]] and create a single class which serves as [[ClientAPI]] as well as [[ProviderAPI]]? You'll be trying to fit an ''open space'' into a singular point (natural representation of a [[ProviderAPI]]). The result is that you'll be forbidden to [[evolution|evolve]] your [[API]] in any way. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
+
The shape of [[ProviderAPI]] is quite different. See [[APIvsSPI]] to understand what happens when you try to merge the ''open space'' with the shape associated with [[ProviderAPI]].
-
 
+
-
 
+
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Evolution]]
[[Category:APIDesignPatterns:Evolution]]

Apidesign at 20:17, 19 March 2011 - 2011-03-19 20:17:52

←Older revision Revision as of 20:17, 19 March 2011
Line 7: Line 7:
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
-
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].
+
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class (one cannot create binary [[BackwardCompatibility]] problems by adding new methods into such class). Exposing only '''final''' classes to users of [[ClientAPI]] makes it bullet-proof:
<source lang="java">
<source lang="java">

JaroslavTulach at 20:14, 19 March 2011 - 2011-03-19 20:14:55

←Older revision Revision as of 20:14, 19 March 2011
Line 8: Line 8:
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].
 +
 +
<source lang="java">
 +
public final class Player {
 +
public void play(File mp3);
 +
public void stop();
 +
 +
/** @since 2.0 we can also control volume */
 +
public void setVolume(int volume);
 +
}
 +
</source>
The shape of [[ProviderAPI]] is quite different. Can you imagine the result, when you mix goals of your [[API]] and create a single class which serves as [[ClientAPI]] as well as [[ProviderAPI]]? You'll be trying to fit an ''open space'' into a singular point (natural representation of a [[ProviderAPI]]). The result is that you'll be forbidden to [[evolution|evolve]] your [[API]] in any way. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
The shape of [[ProviderAPI]] is quite different. Can you imagine the result, when you mix goals of your [[API]] and create a single class which serves as [[ClientAPI]] as well as [[ProviderAPI]]? You'll be trying to fit an ''open space'' into a singular point (natural representation of a [[ProviderAPI]]). The result is that you'll be forbidden to [[evolution|evolve]] your [[API]] in any way. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].

JaroslavTulach at 19:57, 19 March 2011 - 2011-03-19 19:57:47

←Older revision Revision as of 19:57, 19 March 2011
Line 5: Line 5:
As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
-
This can be envisioned as an [[File:OpenSpace.png|open space]] which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
+
This can be envisioned as an '''open space''' which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].

JaroslavTulach at 20:34, 7 March 2011 - 2011-03-07 20:34:35

←Older revision Revision as of 20:34, 7 March 2011
Line 1: Line 1:
-
There is a difference between [[ClientAPI]] and [[ProviderAPI]] evolution rules. As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
+
There is a difference between [[ClientAPI]] and [[ProviderAPI]] [[evolution]] rules.
 +
 
 +
[[Image:OpenSpace.png|thumb|right]]
 +
 
 +
As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
 +
 
 +
This can be envisioned as an [[File:OpenSpace.png|open space]] which grows with a time. To keep [[BackwardCompatibility]], every method, field or class which has been present in previous releases, needs to stay. New methods can however be added as requested. Those [[ClientAPI|clients]] that used to call the previously existing one, don't need to care about the new ones. [[ClientAPI|Clients]] seeking for new functionality will be pleased when it appears in the ''open space'' of your [[ClientAPI]].
 +
 
 +
What is the most suitable coding construct in [[Java]] to support an ''open space''? The most safe one is a '''final''' class. As such it is suggested to expose only '''final''' classes to users of [[ClientAPI]].
 +
 
 +
The shape of [[ProviderAPI]] is quite different. Can you imagine the result, when you mix goals of your [[API]] and create a single class which serves as [[ClientAPI]] as well as [[ProviderAPI]]? You'll be trying to fit an ''open space'' into a singular point (natural representation of a [[ProviderAPI]]). The result is that you'll be forbidden to [[evolution|evolve]] your [[API]] in any way. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
 +
 
-
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it is suggested to expose only final classes to users of [[ClientAPI]]. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
 
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Evolution]]
[[Category:APIDesignPatterns:Evolution]]

JaroslavTulach at 19:49, 7 March 2011 - 2011-03-07 19:49:12

←Older revision Revision as of 19:49, 7 March 2011
Line 1: Line 1:
-
There is a difference between [[ClientAPI]] and [[ProviderAPI]] evolution rules. As soon as you publish an [[API]] targeted for others to call, you, as publisher of your library, want to have the freedom to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your API is that it can be called, then the common requirement is going to be a request to expose more methods and to allow the users to call more functionality.
+
There is a difference between [[ClientAPI]] and [[ProviderAPI]] evolution rules. As soon as you publish an [[API]], you, as a publisher of your library, want to have a freedom to evolve it to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your [[API]] is to be called, then the obvious requirement is to be to add more methods and to allow the users to call more of exposed functionality.
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it is suggested to expose only final classes to users of [[ClientAPI]]. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it is suggested to expose only final classes to users of [[ClientAPI]]. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].

JaroslavTulach at 11:29, 19 August 2009 - 2009-08-19 11:29:52

←Older revision Revision as of 11:29, 19 August 2009
Line 1: Line 1:
-
There is a difference between [[ClientAPI]] and [[APIDesignPatterns:ProviderAPI]] evolution rules. As soon as you publish an API targeted for others to call, you, as publisher of your library, want to have the freedom to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your API is that it can be called, then the common requirement is going to be a request to expose more methods and to allow the users to call more functionality.
+
There is a difference between [[ClientAPI]] and [[ProviderAPI]] evolution rules. As soon as you publish an [[API]] targeted for others to call, you, as publisher of your library, want to have the freedom to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your API is that it can be called, then the common requirement is going to be a request to expose more methods and to allow the users to call more functionality.
-
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it suggested to expose only final classes to users of [[ClientAPI]].
+
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it is suggested to expose only final classes to users of [[ClientAPI]]. If you publish non-final class, or even interface, you'll face [[evolution]] problems as described at [[ExtendingInterfaces]].
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns]]
[[Category:APIDesignPatterns:Evolution]]
[[Category:APIDesignPatterns:Evolution]]

JaroslavTulach at 12:32, 15 November 2008 - 2008-11-15 12:32:54

←Older revision Revision as of 12:32, 15 November 2008
Line 1: Line 1:
-
There is a difference between [[APIDesignPatterns:ClientAPI]] and [[APIDesignPatterns:ProviderAPI]] evolution rules. As soon as you publish an API targeted for others to call, you, as publisher of your library, want to have the freedom to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your API is that it can be called, then the common requirement is going to be a request to expose more methods and to allow the users to call more functionality.
+
There is a difference between [[ClientAPI]] and [[APIDesignPatterns:ProviderAPI]] evolution rules. As soon as you publish an API targeted for others to call, you, as publisher of your library, want to have the freedom to satisfy additional requirements of users of your library. What additional requirements can you expect? In case the only use of your API is that it can be called, then the common requirement is going to be a request to expose more methods and to allow the users to call more functionality.
-
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it suggested to expose only final classes to users of [[APIDesignPatterns:ClientAPI]].
+
What is the most suitable coding construct in [[Java]] to support [[BackwardCompatibility|backward compatible]] additions of new methods? The most safe one is a final class. As such it suggested to expose only final classes to users of [[ClientAPI]].
 +
 
 +
 
 +
[[Category:APIDesignPatterns]]
 +
[[Category:APIDesignPatterns:Evolution]]

JaroslavTulach: APIDesignPatterns:ClientAPI moved to ClientAPI: Shorter names for use with categories - 2008-11-15 12:32:00

APIDesignPatterns:ClientAPI moved to ClientAPI: Shorter names for use with categories

←Older revision Revision as of 12:32, 15 November 2008