Implementation-specific constants in service layer

wargod

New Member
I have an ASP.Net Web Forms project, which is built as (among other things) a user interface to a CRM web service.I have an interface, \[code\]IMembershipService\[/code\], which exposes a number of methods for purchasing different kinds of subscriptions to a service. The concrete implementation of this, \[code\]SpecificMemberService\[/code\], will abstract a number of web service calls to a third-party CRM system.The concrete implementation requires that different 'subscription levels' be passed to it as specific 4-character string codes. Currently, I have defined the following in my service layer:\[code\]public static class MemberTypes{ public const string Basic = "MEM1"; public const string Extra = "MEM2"; public const string Professional = "MEM3";}\[/code\]However, these codes are specific to the concrete class \[code\]SpecificMemberService\[/code\] and - as such - shouldn't really be independent of it as they currently are. How can I expose strongly-typed \[code\]MemberType\[/code\] codes to my web application, which are constant with respect to a concrete implementation of \[code\]IMembershipService\[/code\]?
 
Back
Top