mvp

Repository design pattern - should there be one repo for every Dao?

放肆的年华 提交于 2020-02-21 18:14:49
问题 i have a few DAOs in my app which access a database for CRUD operations. Lets say there News, weather and , sports DAO. So im confused on how many Repositories i would need. should i just use one repository say DataRepository and let me hold my database and all dao's. and encapsulate methods for the CRUD operations in it ? or should each DAO have its own repository ? I mean a repository should return only data objects that the calling layer understands. so its like a encapsulation over the

Repository design pattern - should there be one repo for every Dao?

倾然丶 夕夏残阳落幕 提交于 2020-02-21 18:08:40
问题 i have a few DAOs in my app which access a database for CRUD operations. Lets say there News, weather and , sports DAO. So im confused on how many Repositories i would need. should i just use one repository say DataRepository and let me hold my database and all dao's. and encapsulate methods for the CRUD operations in it ? or should each DAO have its own repository ? I mean a repository should return only data objects that the calling layer understands. so its like a encapsulation over the

Winforms MVP Grid Events Problem

倖福魔咒の 提交于 2020-01-23 03:11:26
问题 I am trying to implement the MVP pattern for WINFORMS. Its a simple for with a button and a Grid, on button click, the grid will load, and user can fill in values into the grid. For my button click event, I have something like this: _presenter.LoadGrid(); Which is simple and straightforward. My question is, in regards to grid... I am planning to have a row click event firing....for enabling/disabling the subsequent input fields for the specific columns/rows of the grid etc. I understand that

Presenter injection with Dagger 2

杀马特。学长 韩版系。学妹 提交于 2020-01-22 12:13:07
问题 I just started using Dagger 2 and I found online thousands guides each one with a different implementation and I'm a bit confused now. So basically this is what I wrote at the moment: AppModule.java: @Module public class AppModule { Application mApplication; public AppModule(Application application) { mApplication = application; } @Provides @Singleton Application providesApplication() { return mApplication; } } DataModule.java: @Module public class DataModule { private static final String

Presenter injection with Dagger 2

那年仲夏 提交于 2020-01-22 12:12:18
问题 I just started using Dagger 2 and I found online thousands guides each one with a different implementation and I'm a bit confused now. So basically this is what I wrote at the moment: AppModule.java: @Module public class AppModule { Application mApplication; public AppModule(Application application) { mApplication = application; } @Provides @Singleton Application providesApplication() { return mApplication; } } DataModule.java: @Module public class DataModule { private static final String

Presenter injection with Dagger 2

扶醉桌前 提交于 2020-01-22 12:12:04
问题 I just started using Dagger 2 and I found online thousands guides each one with a different implementation and I'm a bit confused now. So basically this is what I wrote at the moment: AppModule.java: @Module public class AppModule { Application mApplication; public AppModule(Application application) { mApplication = application; } @Provides @Singleton Application providesApplication() { return mApplication; } } DataModule.java: @Module public class DataModule { private static final String

Restrict violation of architecture - asp.net MVP

北战南征 提交于 2020-01-14 09:52:13
问题 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

Restrict violation of architecture - asp.net MVP

早过忘川 提交于 2020-01-14 09:52:11
问题 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

Restrict violation of architecture - asp.net MVP

浪子不回头ぞ 提交于 2020-01-14 09:52:05
问题 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

Models, Views, View Models and Presenters

99封情书 提交于 2020-01-13 20:23:51
问题 I'm trying to get to grips with different patterns (MVP, MVVM etc) and find one that suits my needs. After all my reading I'm still not sure. Hopefully someone can shed some light on this for me. At the moment I have a WPF View which implements an interface ICustomView. This interface is injected into my Presenter. The presenter then is responsible for subscribing to data, managing subscriptions etc. When the data is returned to the Presenter it calls various methods against the Model (an