views:

347

answers:

2

Web Client Software Factory(WCSF) and Smart Client Software Factory(SCSF) both use MVP pattern.

M-Model can be shared.

V-View has to be different as both are on different platform(Desktop/Web).

I want to know can the P-Presenter can be shared or can I be exactly same for both and how.

+1  A: 

In general, no, that's not how the pattern(s) work. The Model is the reusable portion, and the combination of V + C/P comprise the application layer, and therefore are application-specific by definition.

If you have logic in your presenters that seems like it should be reusable across different applications, you should look at how you can push that down into your domain layer, and make it part of your Model.

This is one of the best articles on the subject.

sliderhouserules
A: 

For the most part, I agree with sliderhouserules. The presenters manipulate UI components according to business rules and are therefore going to be somewhat platform-specific to the UI platform. From what I understand you're wanting to manifest the same application through two different UI platforms. Although, the business rules for this app may stay the same across the two platforms, the UI presentation will be different.

So, perhaps you should look into a creating a shared library where that common business logic your presenters enact can be reused in UI-specific presentation code for each app. I think this could go a long way in reducing platform-specific code.

Travis Heseman