UIPAB / MVC / Model / URL

C

cmay

I have been looking over the UIPAB and how you can use it in ASP.Net.


It seems like, at least from the article that I read, that there really
isn't a Model in this architecture, even though they are saying that
they are implementing MVC. e.g. In the example the view needs to
populate a textfield, and it does so by:
txtMyText.text = MyController.MyText

Basically querying a property of the controller. Is there no Model in
this implementation? Is the Model and Controller rolled into 1?


Also, it looks like the UIPAB uses "Transitions" to move the user
around. So you define the various navigation paths that a user can
have and then execute one of those paths.


Does this mean that all navigation within UIPAB should take place by
means of a post back, as opposed to a hyperlink?


Thanks!
 
J

Joe Fallon

There is an article on the UIP block in this months MSDN magazine.
A quick read of it tells me that:

Model = custom business object
Controller=knows how to use the BO
View=Page code behind that knows how to use the Controller.

The goal seems to be to remove all the detailed code from the page code
behind into the controller.
So that a button click event in the page is resposned to with 1 line of
code:
myController.SomeMethod

The idea is to keep the UI ignorant of the model and only interact with the
controller.

The sample article built a small winforms app and then converted it to
ASP.Net with no changes to the code behind events.

HTH
 
C

cmay

Joe,

It was actually that article that raised these questions!
From their article... on form load they call:

this.firstNameLabel.Text = this.BookingController.PassengerFirstName;


This seems to violate the MVC pattern. I would think that at this
point the Model should be getting information like the person name, not
the controller.


Also, all navigation is done like:

this.BookingController.BookTrip();

which makes me wonder if all ASP.NET navigation must be done via post
backs, rather than just a hyperlink pointing to another page. Maybe
that is considered a feature of UIPAB? I dunno.
 
J

Joe Fallon

ASP.Net navigation works both ways.

The post back should be used when you need to interact with the data (or
controls) on the current page *before* you go to the next page.

Use a hyperlink to navigate directly to another page if there is no need for
interaction.

e.g.
You are on a search page, you enter criteria, you click btnSearch - this
should postback so you can read the texbox values before navigating to the
results page.

On the results page you could have a link to take you back to the search
page.
This does not post back. No need to deal with any input.

But the same results page could have a column of buttons saying "Edit".
When the user clicks one of these buttons you should postback so you can
figure out which button was pushed and get the index of the item inthe grid
so you can then get the PK value out of your results collection and pass it
to the next page.

HTH
 
A

Alvin Bruney [MVP - ASP.NET]

a typo probably???

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
C

cmay

I know HOW you can do navigation w/ ASP.Net, but when you are using the
UIPAB it looks like you are not supposed to use hyperlinks! It seems
that would violate the transition between views and you would lose the
Context b/c you would be putting everything in the querystring.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top