Andrew Stopford's Weblog

poobah

News

Articles

Family

Old Blogs

The trouble with webforms

Ayende has a post on "Removing the leaky abstractions from webforms", webforms do leak abstractions like a water mains with a hole it. I see folks going to great lengths to reduce page bloat by removing all viewstate and in the process creating a kind of ASP on .NET model. MonoRail helps you achieve this goal and does provide a clear seperation of concern by following MVC closely.

Comments

mysterious.e said:

Read the 'leaky' post.

You know I've been using ASP.net since late 2001, and it amazes me when I read posts like I just read. It's perfectly okay to admit that you don't have a good understanding of a technology and recommend areas for greater research. For example, viewstate can per turned off on a per-control basis, and it's factored so it can be compressed, stored in session, database, cached, sent in a post card ... okay maybe not sent in a post card, but it's fairly flexible.

But what was most revealing is when the author said to bypass the ise of the controls to get data and go straight to the Request object becasue the Request is anchored to HttpContext and that can be used anywhere. Interesting ... you know, this sounds like an OO design problem - or lack there of.

If you -know- ASP.net you can really do some neat things. But if you try to bend asp.net to your expectations, instead of learning how it works, it will punish you and make you feel like it's just a bunch of overkill.

ASP.net is a very productive technology once you get through the steep learning curve. Taking on the learning curve is a choice. But don't blame the technology for your own lack of patience or understanding.

# March 5, 2007 10:47 AM

AndrewSeven said:

"For some annoying reason, I still get a _VIEWSTATE variable in the pages, I assume that it is the ControlState, but so far I haven't dug far enough to find yet."

When you don't know what is going on but you know that it is wrong :P

He is not removing the abstraction, he is just choosing to ignore it and to not even use it where it really works.

# March 5, 2007 12:47 PM

Ayende Rahien said:

@mysterious.e,

I am well aware of all the things you can do with a view state, none of which solve the immediately problem, I am working within a stateless environment, but the framework insist of trying to make me work in a stateful model.

I have very good level of familiarity with ASP.Net, and I know very well what the pain points are. Feel free to browse my blog about issues that I have run into with ASP.Net, I do not feel that I speak from ignorance.

Accessing the user input directly from the request get me one major thing, I move the input processing/validation/etc from the view level to the controller level.

This means that I can now test the code easily, since I have the abstraction in place to fake the request when I need it.

@AndrewSeven,

You did saw the yet, right? This is something that I certainly plan to check, just not right now.

# March 5, 2007 1:01 PM

Joe Chung said:

I agree with mysterious.e.  Ayende doesn't know ASP.NET as well as they think.

# March 5, 2007 4:00 PM

andrewstopford said:

Hi Guys,

I see another mass debate heading my way again :)

First off lets not confuse asp.net with webforms, the problems with webforms are well voiced but in general.

Viewstate add's a great degree of page bloat and farming it off just add's cpu cycles. While some may say that's not a great cost, I don't get these kind of costs in other franeworks.

Webforms breaks pattern abstraction, code behind serves as a kind of controller but is coupled to the view too tightly. It actually meets the MVC pattern square on the head but in testability terms is a head ache. I want the ability to test in each unit the code by GUI interactions and should not need to skip it for functional testing. As it stands I can't isolate code behind from view, they need each other to work correctly.

Webforms is tied to a web context very tightly and that once again breaks testability. Returning to the HttpContext issue, its a sealed class so you can't easily mock it. Most folks use their own variant IContext type but you end up with needing to go to great lengths with this approach(and documented on the web already folks).

Getting around most of the concerns of webforms can be tricky and if most of the concerns raised here are concerns your having then I recomend giving MonoRail a shot.

# March 5, 2007 4:59 PM

sylvester sam said:

i have a problem finding information on the topic

"problems and issues of collecting of information via webforms" I was wondering if any one can help me with some urls or any information ,

                                thanks

# October 10, 2007 9:23 AM

Microsoft Makes Really Stupid Moves Sometimes said:

Pingback from  Microsoft Makes Really Stupid Moves Sometimes

# November 2, 2007 2:29 AM

фаберлик said:

It is remarkable, this rather valuable message

# July 10, 2009 6:25 AM

Smoogmato said:

Yes, it is the intelligible answer

# July 11, 2009 1:15 PM

SteakypypeBab said:

You are absolutely right. In it something is also to me your thought is pleasant. I suggest to take out for the general discussion.

# July 14, 2009 1:29 AM

PeediapNeex said:

По моему  тема весьма интересна. Давайте с Вами пообщаемся в PM.

# July 15, 2009 6:11 AM

Mothroovoli said:

вы просто мечтаете о небылой сказке!!! просто хорошее видео!!!

# July 17, 2009 6:12 AM

Evelopalliemi said:

And, what here ridiculous?

# July 19, 2009 5:23 AM

hainihero said:

Absolutely with you it agree. In it something is also to me it seems it is excellent thought. Completely with you I will agree.

# July 20, 2009 4:24 PM

lefeZeleScott said:

Es ist einfach unvergleichlich:)

# July 21, 2009 3:33 PM

едва said:

– Конэ-Эль говорил, что вы просили его помочь в мастерских, поэтому он и должен прийти сегодня. Ну, подумаешь, Конэ-Эль задержится на два дня. Что тут такого? Я в это время помогу.

# September 17, 2009 5:24 PM

стояли said:

 Видимо, время Дарующего прошло, Конхенто у нас,  резюмировал эльф.

# September 22, 2009 8:47 PM

Император said:

 По твоим глазам вижу, что не договариваешь чтото,  Алла Феоктистовна подошла вплотную к Смирнову и пристально посмотрела на него.

# October 3, 2009 4:07 PM

http://www.elena-horvatova.ru/ said:

Просканировав ментальное поле, и убедившись, что поблизости нет больше мутантов, эльф устало опустил Конхен.

# October 11, 2009 6:36 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)