Skip to content

Instantly share code, notes, and snippets.

@tohenryliu
Created October 11, 2012 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tohenryliu/3875359 to your computer and use it in GitHub Desktop.
Save tohenryliu/3875359 to your computer and use it in GitHub Desktop.
versioning idea
package versioning
// version 1 defined 2 actions here
trait V1 {
val SetOptOut = EmailPreferenceActions.SetOptOut
val GetSailthruEmail = EmailPreferenceActions.GetSailthruEmail
}
object V1Api extends V1
// version 2 need to replace SetOptOut with SetOptOutImproved
// while keeping the other ones the same as V1
trait V2 extends V1 {
override val SetOptOut = EmailPreferenceActions.SetOptOutImproved
}
object V2Api extends V2
object EmailPreferenceActions {
case class SetOptOut ...
case class GetSailthruEmail ...
case class SetOptOutImproved ...
}
object EmailPreferenceActionsWithRedis {
case class SetOptOutImproved ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment