Let's say I have an object class (widgetBlue
). This object class fulfills an interface (iWidgetBlue
) and inherits from an abstract class (widget
). widgetBlue
does NOT have an explicitly coded constructor and has information needed to perform actions against it.
I want to be able to create an instance of widgetBlue
in WidgetService
to be returned to the consumer so that they can work with it but not allow the consumer to create an instance of widgetBlue
out of the blue. WidgetService
needs to be able to create a new widgetBlue
and instantiate its properties.
So this would be okay:
WidgetBlue retVal = SomeRemoteMethodThatReturnsAWidgetBlue();
But this would not be okay:
WidgetBlue retVal = new WidgetBlue();
Edit: Furthermore, the widget objects are all in their own project and referenced by both the consumer and the service.
How would I do this?