R
russ
Hi,
We have stumbled across an issue using the type safe collection
System.Collections.ObjectModel.Collection <T> to retrieve data from our
data layer.
Say we have a customer object and want to get a type safe collection of
all customers who have spend = X
Within our datalayer we would currently have the following method
public static ArrayList GetCustomersWithSpend(Type type, double spend)
{
// use custom or mapper here
return ObjectSpace.GetCollection(type,"where spend =" +
spend.ToString());
}
However, say we wanted to use a type safe generic collection I guess we
would use this;
public static
System.Collections.ObjectModel.Collection<Customer>(double spend)
{
}
But this would break the n-tier seperation as our datalayer now knows
about the Customer type.
I guess we could still return an ArrayList from the datalayer and then
create the type safe collection in the business tier using the
ArrayList.
Does anyone have any thoughts on this?
Cheers
Russ
We have stumbled across an issue using the type safe collection
System.Collections.ObjectModel.Collection <T> to retrieve data from our
data layer.
Say we have a customer object and want to get a type safe collection of
all customers who have spend = X
Within our datalayer we would currently have the following method
public static ArrayList GetCustomersWithSpend(Type type, double spend)
{
// use custom or mapper here
return ObjectSpace.GetCollection(type,"where spend =" +
spend.ToString());
}
However, say we wanted to use a type safe generic collection I guess we
would use this;
public static
System.Collections.ObjectModel.Collection<Customer>(double spend)
{
}
But this would break the n-tier seperation as our datalayer now knows
about the Customer type.
I guess we could still return an ArrayList from the datalayer and then
create the type safe collection in the business tier using the
ArrayList.
Does anyone have any thoughts on this?
Cheers
Russ