Re: View layer implementation




"Big Steel" <fake@xxxxxxxx> wrote in message
news:almarsoft.8461828712395487781@xxxxxxxxxxxxxxxxxxxxxxxxxx
On Fri, 7 Jan 2011 19:44:54 -0600, "mp" <nospam@xxxxxxxxxx> wrote:
another silly newbie question(s):
So I have a view/presenter/business layers setup
(i have a service layer too, but not sure what i'm supposed to be
doing with
that...at least in this example)

The service layer
[...]>
If this is a Windows desktop solution and it is not a multi user
application, then you don't need the service layer. You can have the BLL
directly call the DAL.

ok in my current project I don't need the service layer...I have just been
trying to 'copy' the mvp project layout you linked me to recently (obviously
i don't understand what i'm doing)...the other responders have pointed out I
shouldn't have separate projects and that all these 3 pieces are in one
layer...the sample project had 4 projects and called them different
layers(iirc)

[...]

The Interface should be for the entire form.

but is it correct that the interface is defined in the presenter?

All the controls on the
form are represented in the IView.

are the controls represented as properties?

[...]

//a button in the view raises an event
private void btnLoadPortfolio_Click(object sender, EventArgs e)
[...]

It seems ok from what I can see.

[...]


The get/set should be in the IView for the control.

sorry i'm not understanding....
if i have a form with a button and a datagridview
what would that code look like?


The get/set for the control would be in the Interface of the form.

At the UI form in its Interface, the get/set will point to a control on
the form. If mpListview in the name of a control on the form, the get
(mpListview) and the set (mpListview) = value will be used. The
impListview is getting and sitting the control mpListview on the form.

In the presenter.......

var ctrl = mview.impListview ..... the get

mview.impListview.Datasource = p ... the set




mpListview is an object,

meaning the presenter doesn't know *what kind of* object?
only the form knows it's own actual controls, right?
so lets say i have 3 different forms
one displays in a textbox, one displays in a listview, and one displays in a
DataGridView
they could each implement the same interface
and the interface would have a definition for, lets say, "DisplayObject"
and the presenter won't know or care what kind of display object it's
talking to...just that there's an interface and properties it sets
??? am I totally off track here...i'm feeling very lost after the last batch
of responses I've gotten...

thanks for hanging in with my beginner ignorance
Mark



.



Relevant Pages

  • Re: View layer implementation
    ... The service layer would be called by the business layer. ... Each form you have in your application, it has its own IView and presenter that represents the controls on the form with the presenter working with the controls The presenter for each form can share the same BLL. ... At the UI form in its Interface, the get/set will point to a control on the form. ... If mpListview in the name of a control on the form, the get and the set = value will be used. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: how to best organize an MVP solution
    ... model, presenter and UI. ... concrete types. ... The view interface is also in the presenter project. ... A service layer project with a service class sits between the presenter and the model. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Help Request: "Class Not Registered"
    ... appreciate that the 'basic rules' for how an ActiveX ... Control should behave with a client came from the orginal VB product, ... Interfaces and Interface Inheritance. ... some MFC one. ...
    (microsoft.public.vb.enterprise)
  • Re: Accessing value of a Variable in parent from custom control
    ... get some kind of information from the parent form in which the control ... If Form1 implements an interface, it means that you must provide the ... Implements iUsesMyControl ... Public Property FormString() As String Implements ...
    (microsoft.public.dotnet.framework)
  • Re: Accessing value of a Variable in parent from custom control
    ... problem is that the control is not awair of either the iUsesMycontrol ... get some kind of information from the parent form in which the control ... If Form1 implements an interface, it means that you must provide the ...
    (microsoft.public.dotnet.framework)