About Stock Trader Architecture

Topics: Prism v2 - Silverlight 3
May 20, 2010 at 11:31 AM


Prism sugegsts modular programming and there are  4 modules in the stock trader implementation viz Position,Market,Watch and News modules.

As per Prism , each module has its own view and services with in it.  It makes sence to keep module-related objects inside the respective modules..

Few modules have interfacecs with in it(position module) and some modules(Market module ) have the implementations of the interfaces that is defined in the Infrastructure Layer.

1. Why is this inconsistancy

2.  As per the archecture, the model/modules/Domain layer can have the interfaces where as the actual implementations should be in the infrastructure layer(Seperated Interface Pattern).

3. Is there any specific reason for keeping  the implementations inside the module and the respective interfaces in a different project ?..

4. If am right , will this issue be address in the next release ..

If am wrongly understood Stock implementation, Please explain me abot this.


Thanks & Regards


May 20, 2010 at 3:32 PM

I haven't looked at this reference application in detail, but what they have done actually makes sense. It will allow you to develop other modules that implement the same interface, but with wholly different implementation. Usually, interfaces are defined in a core/common or as in prism, an infrastructure project. There are exceptions, where the interface is intended for internal consumption within the module and not exposed beyond the module boundaries. If your interface is exposed externally to the module, then it should be in a separate class library, otherwise consumers will have to make a reference to your library with concrete implementation. The exception to this, is when your concrete implementation is a default implementation, and you expose interfaces to allow consumer to write their own concrete implementation. However, this latter is more prevalent in frameworks...look at prism as an example. Just my two cents.


May 21, 2010 at 5:40 AM

Thanks for the clarifications.