mvp

Android MVP: which layer should store context variable

只愿长相守 提交于 2019-12-18 22:33:52
问题 I find myself where i need to play a sound file when user clicks a button on a view. MediaPlayer requires a context to be created. What is the best way to put MediaPlayer initialization code? Should I pass a context into a presenter method and play it there? Or is it ok to just play on the view. 回答1: Context is a part of Android View Layer in MVP, so Presenter must not have any idea about it and you should not pass it to presenter . You have to add a methods to your View interface and

“Illegal characters in path.” Visual Studio WinForm Design View

我的梦境 提交于 2019-12-18 19:01:36
问题 I am putting together a lightweight MVP pattern for a WinForms project. Everything compiles and runs fine. However when I attempt to open the WinForm in design mode in Visual Studio I get a " Illegal characters in path " error. My WinForm is using generics and inheriting from a base Form class. Is there a problem with using generics in a WinForm? Here is the WinForm and base Form class. public partial class TapsForm : MvpForm<TapsPresenter, TapsFormModel>, ITapsView { public TapsForm() {

What's your recommendation for architecting GWT applications? MVC, MVP or custom messaging solution?

怎甘沉沦 提交于 2019-12-18 10:20:01
问题 I just started a new GWT project for a client and I'm interested in hearing people's experience with various GWT MVC architectures. On a recent project, I used both GXT MVC, as well as a custom messaging solution (based on Appcelerator's MQ). GXT MVC worked OK, but it seemed like overkill for GWT and was hard to make work with browser history. I've heard of PureMVC and GWTiger, but never used them. Our custom MQ solution worked pretty well, but made it difficult to test components with JUnit.

Comments on my MVP pattern for Android

♀尐吖头ヾ 提交于 2019-12-17 23:09:05
问题 I am planning to use MVP pattern for my new Android project. I have done some sample code and I would like to know, have I implemented it correctly? Please give comments on the code and also post your suggestions. my activity class I am extending it from my BaseView class and I am implementing an interface. this activity simply calls an webservice in a new thread and updates the value in the textview. public class CougarTestView extends BaseView implements ICougarView, OnClickListener {

In MVP where to write validations

試著忘記壹切 提交于 2019-12-17 15:46:49
问题 In Model-View-Presenter pattern where should we write validations of user input. 回答1: Domain specific rules/validations should be in the Model. You can have a model.validate() to let you know if the rules are not violated. Look at Rails model (ActiveRecord) classes for a good implementation of this concept. The View should make it difficult for the user to key in invalid input. So 'entering a string for a numeric value' class of input errors should be nipped before reaching the presenter.

Composite Guidance for WPF : MVVM vs MVP

假如想象 提交于 2019-12-17 15:36:37
问题 I am confused. Maybe you can help me :) I have been following the guidance of CAG and found the MVP pattern very natural to me. Suppose I have a UI-ready Model (for example : implements INotifyPropertyChanged), I use the presenter to bind this Model to a view (presenter knows an interface of the view), keeping my Code-Behind as small as possible handling only Bindings (Model and Commands) properties (or methods) or events for controls that don't have ICommand and in this case immediately

MVP examples for Windows Forms

偶尔善良 提交于 2019-12-17 04:14:26
问题 Is there good example code or a test project for explaining the Model–view–presenter (MVP) pattern. There are a lot of explanation links, but I want to have some good example code to show others without reinventing the wheel. 回答1: Jeremy Miller's "Build your own CAB" series is fantastic. You get a nice dose of MVP (along with some other smart client patterns such as Pub/Sub). http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx 回答2:

Architecture Suggestions/Recommendations for a Web Application with Sub-Apps [closed]

妖精的绣舞 提交于 2019-12-13 22:05:23
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I’m starting to plan an architecture for a big web application, and I wanted to get suggestions and/or recommendations on where to

How to implement async pattern in windows forms application?

孤者浪人 提交于 2019-12-13 20:09:40
问题 I'm using an MVC pattern in winforms application. I need to call remote service asynchronously. So On some event in View I invoke corresponding Presenter method. In Presenter I call BeginInvoke method of service. But to View must be updated only in Main Thread. I could actualy point CallBack to some function in View, and update it`s controls state, but this conflicts with MVP pattern - View must not be responsible for data it carries. This callback function must be in Presenter. But how then

Why is JSF considered MVP but not MVVM framework

大憨熊 提交于 2019-12-13 19:10:14
问题 From the wiki page about JSF I've learnt that it's considered as an MVP framework. But I cannot realy understand why. Actully, beans do not contain a reference to View in themselves. There's also a data bidinig mechanism between Facelets and Managed beans. So I would say that Managed Beans are more ViewModel than Presenter , as that Presenter usually contain a View interface in itself like in that example. QUESTION : Why is JSF considered MVP but not MVVM framework? 回答1: MVVM is mainly a