Good evening experts:
My team is currently implementing an application that will manage a list of drugs. To accomplish this task, we have implemented several data transfer objects to maintain these data. One data transfer object, MyDrugList contains a single attribute of type List<DrugDetailDto> drug. In this case, drug allows us to manage a list of drug objects .. add, remove, find, etc; however, upon submitting for code review, our enterprise architect pointed out a flaw in the development process and indicated we need not expose our List<T> objects: ( http://msdn2.microsoft.com/en-us/library/ms182142(VS.80).aspx
As an alternative, he suggested that we implement the IList interface to transfer objects between our layers. I somewhat understand his requirement, but now some of our methods are not wanting to cooperate, which I've included below ..
1) Could someone explain why this is an issue?
2) Could someone assist with how we can implement our search methods using these IList implementations?
We are using 2.0 Framework .. C#
Here is an example of where we search a DrugDetailDTO object for specific product data:
/// Extracts product information attached to a drug for a specified formulary
private DrugProductDTO GetProductDetail(DrugDetailDTO drug, string formularyID)
/// Extracts Drugs information that has generics equivalents available
private List<DrugDetailDTO> ExtractGenericsFromDrugList(List<DrugDetailDTO> myDrugList)
However, the find, findall, exists methods are not available with the IList interface.