[Obsolete]
public static string FormatAddress(string address){ //Old method. It supports format for local address only. Use the new method instead
...
}
public static string FormatAddress(string address, CountryCode country){//New method. It supports internationalization.
...
}
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
- Later, Team A decides to extend the library. While doing so, Team A realizes that there is no way to squeeze additional functionality into the existing APIs. New APIs have to be added to supersede the old ones. Team A wants the library users (Team B) to no longer use the older APIs for future development, but the old APIs are still there for backward compatibility purposes. Team A marks the older APIs as obsolete (or deprecated in Java).
- Team B updates the component written by Team A. Team B has no clue what has changed in the component and they don't need to know. When they try to compile, Team B's code still work (because the older APIs are still there) but they receive warning from the compiler that they use obsolete types/functions that the library writer (Team A) has discouraged to use. It would be better if the message also includes reference to the new APIs that Team A recommends. Team B can choose to ignore it and use the new APIs for future development, or refactor existing codes to adopt the new APIs.
On Tue, Apr 28, 2015 at 2:09 AM, Henry Adi Sumarto <henry.ad...@gmail.com> wrote:
- Later, Team A decides to extend the library. While doing so, Team A realizes that there is no way to squeeze additional functionality into the existing APIs. New APIs have to be added to supersede the old ones. Team A wants the library users (Team B) to no longer use the older APIs for future development, but the old APIs are still there for backward compatibility purposes. Team A marks the older APIs as obsolete (or deprecated in Java).
As part of deprecating the old API, team A writes input for the eg tool (golang.org/x/tools/cmd/eg) to convert the old API to the new one.
- Team B updates the component written by Team A. Team B has no clue what has changed in the component and they don't need to know. When they try to compile, Team B's code still work (because the older APIs are still there) but they receive warning from the compiler that they use obsolete types/functions that the library writer (Team A) has discouraged to use. It would be better if the message also includes reference to the new APIs that Team A recommends. Team B can choose to ignore it and use the new APIs for future development, or refactor existing codes to adopt the new APIs.
When team B updates the component, they see the release notes and run the eg tool input. Their code is updated.
I have no idea if this would work in general but it seems like a better approach than marking a function as deprecated. I would prefer to consider that approach first.
Ian
--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/aRhTutV27SI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.