Restrict violation of architecture - asp.net MVP
Posted
by Srikanth
on Stack Overflow
See other posts from Stack Overflow
or by Srikanth
Published on 2010-04-27T05:11:23Z
Indexed on
2010/04/27
5:13 UTC
Read the original article
Hit count: 262
If we had a defined hierarchy in an application. For ex a 3 - tier architecture, how do we restrict subsequent developers from violating the norms?
For ex, in case of MVP (not asp.net MVC) architecture, the presenter should always bind the model and view. This helps in writing proper unit test programs. However, we had instances where people directly imported the model in view and called the functions violating the norms and hence the test cases couldn't be written properly.
Is there a way we can restrict which classes are allowed to inherit from a set of classes? I am looking at various possibilities, including adopting a different design pattern, however a new approach should be worth the code change involved.
© Stack Overflow or respective owner