MVP Pattern
-
Hi everyone, I am developing for my company a project management system using C# / .NET and MVP pattern. Now I encouter the following design problem: - I have a project selector GUI containing the list of all available projects where the user can choose one or several project(s) like this: --------- Please choose one or several projects: Project 1 Project 2 Project 3 .... Project n [Open button] ---------- - After choosing one or several projects, a tab appears displaying all project names and the project structure in tree form of the currently tabed-active project is displayed. The project tree consists of working packages and workitems while working packages can in turns contain work items or working items itself (composit pattern), something like this Project 1 ---Kick off phase ---Specification analyze ---- Analyze A -----Analyze B ---Implementation ..... The user can click on the item in the project tree have the detailed information displayed, e.g. detailed information of the current project when the root node (Project 1 above) is selected or of working package when a working package node is selected and of work item when a work item is selected. My question is: how to model all that stuffs in MVP pattern. I guess it would make sence to have a MVP triad like ProjectStructureView - ProjectStructurePresenter - ProjectStructureModel. But should I have each MVP triad for each kind of project item in the tree (project, package, workitem) ? The fact is, all the displayed information for the current project has only to do with project. So the other question is: what should be stored in for example ProjectStructureModel? Your answer would be really appreciated! Regards.
-
Hi everyone, I am developing for my company a project management system using C# / .NET and MVP pattern. Now I encouter the following design problem: - I have a project selector GUI containing the list of all available projects where the user can choose one or several project(s) like this: --------- Please choose one or several projects: Project 1 Project 2 Project 3 .... Project n [Open button] ---------- - After choosing one or several projects, a tab appears displaying all project names and the project structure in tree form of the currently tabed-active project is displayed. The project tree consists of working packages and workitems while working packages can in turns contain work items or working items itself (composit pattern), something like this Project 1 ---Kick off phase ---Specification analyze ---- Analyze A -----Analyze B ---Implementation ..... The user can click on the item in the project tree have the detailed information displayed, e.g. detailed information of the current project when the root node (Project 1 above) is selected or of working package when a working package node is selected and of work item when a work item is selected. My question is: how to model all that stuffs in MVP pattern. I guess it would make sence to have a MVP triad like ProjectStructureView - ProjectStructurePresenter - ProjectStructureModel. But should I have each MVP triad for each kind of project item in the tree (project, package, workitem) ? The fact is, all the displayed information for the current project has only to do with project. So the other question is: what should be stored in for example ProjectStructureModel? Your answer would be really appreciated! Regards.
Quang Tran Minh wrote:
My question is: how to model all that stuffs in MVP pattern.
Quang Tran Minh wrote:
So the other question is: what should be stored in for example ProjectStructureModel?
led mike
-
Quang Tran Minh wrote:
My question is: how to model all that stuffs in MVP pattern.
Quang Tran Minh wrote:
So the other question is: what should be stored in for example ProjectStructureModel?
led mike
that was a very cynical answer. Probably the question have been answered too many times with different variations. There are many ways to implement mvp , i use MVC now after the Fowlers retirment note http://www.martinfowler.com/eaaDev/[^] in ASP.NET the MVP has many uses . some of my favorites papers are www.object-arts.com/papers/TwistingTheTriad.PDF[^] http://c2.com/cgi/wiki?ModelViewPresenter[^] http://www.wildcrest.com/Potel/Portfolio/mvp.pdf[^] in Codeproject also has classical articles and CodeGuru. Project Model must have . the information about project as you imagine and functionality of how to modify it . Model may also communicate with the database .or ... there are many issues you must find yourself .
f(yf) = yf
modified on Wednesday, March 5, 2008 2:53 PM
-
that was a very cynical answer. Probably the question have been answered too many times with different variations. There are many ways to implement mvp , i use MVC now after the Fowlers retirment note http://www.martinfowler.com/eaaDev/[^] in ASP.NET the MVP has many uses . some of my favorites papers are www.object-arts.com/papers/TwistingTheTriad.PDF[^] http://c2.com/cgi/wiki?ModelViewPresenter[^] http://www.wildcrest.com/Potel/Portfolio/mvp.pdf[^] in Codeproject also has classical articles and CodeGuru. Project Model must have . the information about project as you imagine and functionality of how to modify it . Model may also communicate with the database .or ... there are many issues you must find yourself .
f(yf) = yf
modified on Wednesday, March 5, 2008 2:53 PM
-
Hi led mike and papadimitriou, thanks for your reply. In fact I've read many available papers, tutorials about MVP patter include some of your suggested ones. My question goes directly to this particular project. The root of the project structure tree is the project itself. The root has a list of sub items that are either a working package that can in turns has a list of sub items (working package or work item) or a work item (leaf node). In my implementation, composite pattern is used to model this: class abstract ProjectElement class Project: ProjectElement { List subItems; } class Package: Project { List subItems; } class WorkItem: Project { } inspirated from some articles about Presenter first method by mean of thinking in "When":), my thoughts are: - When the user opens a project, he sees the projecture structure => aha MVP triad ProjectStructureView-ProjectStructurePresenter-ProjectStructureModel - When the user clicks on an item (which can be either project, package or workitem like explained above) an editor dialog is displayed showing the detailed information of the currently selected node (again project, package or workitem). The user can edit / change these information => MVP triad: ProjectElementEditorView-ProjectElementEditorPresenter-ProjectElementEditorModel. I am stuck at this point: the ProjectElementEditor is an abstract concept (abstract class) which can be either project, package or workitem. My question would be: Does the MVP triad ProjectElementEditorView-ProjectElementEditorPresenter-ProjectElementEditorModel make sence? Then the ProjectElementEditorPresenter would has an generic interface to a ProjectElementEditorView (which can be either Project general information editor, package information editor or workitem information editor) or should I define for each type of view a MVP triad like: ProjectGeneralInfoEditorView - ProjectGeneralInfoEditorPresenter-ProjectGeneralInfoEditorModel PackageInfoEditorView - PackageEditorPresenter-PackageEditorModel WorkItemEditorView - WorkItemEditorPresenter-WorkItemEditorModel Hope it makes the problem clearer :)
-
Hi led mike and papadimitriou, thanks for your reply. In fact I've read many available papers, tutorials about MVP patter include some of your suggested ones. My question goes directly to this particular project. The root of the project structure tree is the project itself. The root has a list of sub items that are either a working package that can in turns has a list of sub items (working package or work item) or a work item (leaf node). In my implementation, composite pattern is used to model this: class abstract ProjectElement class Project: ProjectElement { List subItems; } class Package: Project { List subItems; } class WorkItem: Project { } inspirated from some articles about Presenter first method by mean of thinking in "When":), my thoughts are: - When the user opens a project, he sees the projecture structure => aha MVP triad ProjectStructureView-ProjectStructurePresenter-ProjectStructureModel - When the user clicks on an item (which can be either project, package or workitem like explained above) an editor dialog is displayed showing the detailed information of the currently selected node (again project, package or workitem). The user can edit / change these information => MVP triad: ProjectElementEditorView-ProjectElementEditorPresenter-ProjectElementEditorModel. I am stuck at this point: the ProjectElementEditor is an abstract concept (abstract class) which can be either project, package or workitem. My question would be: Does the MVP triad ProjectElementEditorView-ProjectElementEditorPresenter-ProjectElementEditorModel make sence? Then the ProjectElementEditorPresenter would has an generic interface to a ProjectElementEditorView (which can be either Project general information editor, package information editor or workitem information editor) or should I define for each type of view a MVP triad like: ProjectGeneralInfoEditorView - ProjectGeneralInfoEditorPresenter-ProjectGeneralInfoEditorModel PackageInfoEditorView - PackageEditorPresenter-PackageEditorModel WorkItemEditorView - WorkItemEditorPresenter-WorkItemEditorModel Hope it makes the problem clearer :)
Quang Tran Minh wrote:
an editor dialog is displayed showing the detailed information of the currently selected node
dialogs are from Windows 3.0 User Interfaces. Today you can do things like have a splitter so you can present your navigation in one splitter pane and a different view, say for editing, in the other. Also for .NET applications the PropertyGrid works brilliantly for an editor mechanism
Quang Tran Minh wrote:
When the user clicks on an item (which can be either project, package or workitem like explained above)...
The Properties of the item are displayed in the PropertyGrid
led mike