G
Guest
Consider the following class layout
public class Order
{
public ProductOrder AddProductOrder(/* variables required to create a
product order */)
{
/* Check if the product order can be added to the order */
}
public class ProductOrder
{
// This cant be private if i want to use it from the encapsulating
class!
private ProductOrder(/**/)
{
}
}
}
The idea is to control access to the inner class, because the inner class
can not exist without the outer class, but i can't make the ctor private
because it''s not visible from the encapsulating class. If anyone can solve
the above without exposing the ctor of the inner class outside of the wrapped
class I would like to hear from you. Also, if you know some great sites or
books which discuss design patterns which are relevant to business logic,
please point me in the right direction
public class Order
{
public ProductOrder AddProductOrder(/* variables required to create a
product order */)
{
/* Check if the product order can be added to the order */
}
public class ProductOrder
{
// This cant be private if i want to use it from the encapsulating
class!
private ProductOrder(/**/)
{
}
}
}
The idea is to control access to the inner class, because the inner class
can not exist without the outer class, but i can't make the ctor private
because it''s not visible from the encapsulating class. If anyone can solve
the above without exposing the ctor of the inner class outside of the wrapped
class I would like to hear from you. Also, if you know some great sites or
books which discuss design patterns which are relevant to business logic,
please point me in the right direction