Python getting become the heart of data analysis works. You can see variety of books…
Recently, while working on one of the Windows Azure migration engagement, we were need to…
Bill Wilder who is a MVP in Windows Azure has taken nice initiative in the…
Category | Service Design |
---|---|
Scope | Technical |
Reference | Pair Type |
While registering a customer details, as part of address details, system A asks to enter address type which could be home, work or vocation address.
Every applications rely on collection of master data. Some are core to the business and some are required optionally for the business. For example, a set of country is used more or less by all vertical domain systems, but a set of health issues is core to clinicals system in health care domain. "Postal address type" is one such master data uses to specify whether the given customer address is his work, home or vocation address in a sales management system which is used to make correspondence with the user or direct visit to the customer place.
Master data should be understandable across system, geography and languages. It is typically a code value. For example, "IN" is the ISO country code value for India. An enterprise system which handles country data should use either this or other country code value so that it makes the system interoperable. The user interface layer resolves this code value to the actual value which might be either english or any other language. This is more important in health care applications, for example, health issue for a patient need to be persisted as a health standard code since the terms used on one geographical region could not be understandable in another region. Standard codification system helps to resolve this interoperability issue. SNOMED CT, HL7 are examples for codification standard for health care domain. It is important to define data contracts of a service which carry master data item as coded type which contains the code system and code value. It is upto the service consumer to resove these code value into appropriate description.
There are some master data in the system, based on these, the behavior of the system is driven. Using code system with value makes the implementation logic as less readable and logic might not be direct as well. This will end up with inconsistent domain state across the application. Let us take sales management system, the logic to verify a particular address is home or work, the code would be
if(addressType.CodeSystem == "CodeSystemA" && addressType.CodeValue == "Home") { // do the logic }
Here, the the logic checks whether the code system is "CodeSystemA" and value is "Home". Based on this, some behavior is implemented. It is upto the developer to write right hand side literal of code value (here, "Home") in the above example. Instead, if a library which has these set of values would enforce the developer to consume only meaningful code values.
In general, master data for an enterprise system can be divided into three types:
Examples for "Finite native master data set":
Examples for "Finite master data set":
Examples for "Infinite global master data set"
Finite native set contains data those are main factor for system behavior, generally, status fields or fields used in conditional statements. For example, in personal care management system, based on the address type and primary address, the personal carer decides where they meet patient. Unlike finite set or infinite global set, these data set also need to be there in in-memory in addition with physical data store so that it can be directly accessed in the code with underlying language convention. System.Enum type in .NET enables to provide in-memory data store which:
In the example given in problem section, create SysAAddressType enum for address type defined in CodeSystemA. This will make the code like:
if(addressType == SysAAddressType.Home)
// do the logic
However these enum type is not recommended to be part of data contract of a service definition as specified in the problem section. Hence, a mapping between code value and respective enum value is required.
< Prev | Next > |
---|
© 2011 Udooz.net All Rights Reserved.