Building a web application with OO

N

Nick

I am doing some research into building web applications using Object
Oriented techniques. I have found the excellent patterns section on the
MSDN site, but other than that I cannot find any good, concrete examples. I
know Microsoft are really pushing OO with the .NET Framework and C#, but for
web stuff I am finding good examples sparse. Can anyone offer some links to
articles, whitepapers, sites etc that maybe give a good overview of the
techniques involved with building an OO based web application? I have looked
on ASP.NET but found nothing other than data-centric web applications, which
isnt what I want.

Thanks

Nick.
 
S

Steve C. Orr [MVP, MCSD]

The .NET framework itself is very OO. You can use it in object oriented
ways, including inheriting from many of the classes & such:
http://msdn.microsoft.com/library/d.../en-us/dnaspp/html/aspnet-pageobjectmodel.asp

Ditto for the whole object model of ASP.NET:
http://msdn.microsoft.com/library/d...tml/frlrfsystemwebhttpcontextmemberstopic.asp

And every page is a class that is used in very object oriented ways:
http://msdn.microsoft.com/library/d.../en-us/dnaspp/html/aspnet-pageobjectmodel.asp
 
S

Scott M.

I think you should go back and learn about the .NET Framework. Look at the
..NET Framework Base Class Libraries. .NET is all about OO, so it's not a
matter of finding where OO is used, it's a matter of understanding the whole
architecture. For example, the web page itself is a programmable,
inheritable object.
 
A

Adie

Nick said:
I have found the excellent patterns section on the MSDN site

Hi, I haven't seen the patterns section on MSDN, would you mind giving
me the URL?
 
N

Nick

OK maybe my question was poorly written. While the whole framework is
purely based on OO, writing web applications isnt quite as rigorous. As a
comparable example, consider the Struts framework for J2EE based web
systems. ASP.NET provides a fairly reasonable attempt at Page Controller
with its code-behind pages, but I have found in my experience this isnt
enough to promote good extensibility and good separation of concerns.
 
N

Nick

Hi Scott thanks for getting back to me. As you are aware the whole
framework is based on OO. However, (and just ignore the fact OO is the
basis the framework) the stuff on the web and from the MSDN site offer
suggestions for systems building that are quite clearly not OO in the true
sense. Some of the stuff on ASP.NET shows how to build web applications in
ASP.NET/C#/VB.NET. By definition these must be OO solutions right? Wrong.
Just because the term object is used, to me doesnt conclude that OO is being
used, and certainly doesnt conclude OO is being used well or effectively.
Indeed the solution advice I found on ASP.NET clearly admitted that the
design was data-centric. I am looking for stuff thats on a par to Struts for
J2EE.

When I say OO based web application, I mean one that is :

1. Broken down into relevant classes
2. Has a good separation of concerns
3. Supports the removal of duplication through abstraction
4. Is extendible

Now you could come back and say you get all of this with the winforms and
code-behind. But I have spent 12 months working with a team on this type of
system, and the OO parts in the web tier have become more monolithic as the
system has become more complex. Right now, I am considering other options
than the vanilla support with web forms, because I am working on a new
system that is extremely complex and has a lot of OO at its core. Likewise
I would like to achieve the same throughout the layers. I may well be that
the way we built the system I have been working on for a while is completely
wrong, but it has been done so with Microsoft people and certified people
along with good OO developers. But all of us are unhappy wit the results,
and feel it was more the way we worked with the winforms that caused us the
problems.
 
D

David

OK maybe my question was poorly written.

It really wasn't.
While the whole framework is purely based on OO, writing web
applications isnt quite as rigorous. As a comparable example,
consider the Struts framework for J2EE based web systems. ASP.NET
provides a fairly reasonable attempt at Page Controller with its
code-behind pages, but I have found in my experience this isnt enough
to promote good extensibility and good separation of concerns.

I've not seen anything along the lines of Struts for .NET, although
there may be (probably are) some high-end products I don't know about.
A good start at looking at various OO techniques for ASP.NET is grabbing
the larger samples from MS, like Duwamish, Fitch and Mather, the Pet
Shop sample, etc., although as you've mentioned some of those aren't
particularly OO.

Rockford Lhotka's CSLA .Net (www.lhotka.net) is probably the closest
thing to an OO framework I've seen, but I haven't really looked closely
at it yet and so I can't really comment. But given his track record,
I'd say it's definitely worth looking at if you're interested in better
OO architectures in the .NET environment.
 
N

Nick

Hi David,

Thanks for the reply. I have just been reading some stuff from the link you
have provided. It seems the CSLA is interesting. One thing I have noticed,
even with the big push towards a more OO based environment, is that the
envelope still hasnt been pushed. I am looking at the latest Petshop
example from Microsoft, and even that still needs to push the envelope, at
version 3. Separation of concerns, and simple, crisp abstractions are what
OO is all about. Its ok to make pragmatic decisions about whether you
decide to use something like Transaction Script or Active Record, where the
logic for DB access is coupled tightly with the business logic. But if the
domain model of an OO based system, be it a web app or not, is rich and
complex, these simple examples just dont cut it. The PetShop example is one
taken purely out of context I think, from Microsofts perspective. Their
original version was horrendous from a software development good practice
perspective. Version 3 looks a lot better, but the objects still arent
crisp and there is still redundancy in the web tier.

Thanks David,

Nick.
 
D

David

Hi David,

Thanks for the reply. I have just been reading some stuff from the
link you have provided. It seems the CSLA is interesting.

Ironically, since you mentioned struts, VS.NET wound up at the msdn site
again today (totally off-topic, but does anyone know how to get to the
Start window in VS after it's closed?) and they just posted an article
that compares ASP.Net and Struts development. It's more of a rah-rah,
go team article than a serious analysis, but there's some interesting
stuff.
One thing
I have noticed, even with the big push towards a more OO based
environment, is that the envelope still hasnt been pushed. I am
looking at the latest Petshop example from Microsoft, and even that
still needs to push the envelope, at version 3.

Yeah, I'm not disagreeing, I was just pointing to the samples as a
source of ideas. I'm not exactly sure why, but there's always been a
real lack of good mid-to-high level literature/samples in the MS
development world. I suspect it's partially because there's so many
beginners, they sort of drown the rest of the market (not unlike the
newsgroups at times), and partially because there simply isn't the
vendor competition to encourage robust debate.

Of course, .Net is still pretty new, and already I think the literature
out there is much, much better than MS development tools have enjoyed in
the past.

Anyway, my main point was that the situation that you're in, one major
project that you aren't entirely happy with, is pretty much the
situation everyone's in (especially since 2001/2002 was so bad
economically, which led to late adoption of .NET in major markets). I'd
expect to see more mature frameworks and patterns next year some time,
after lots of folks have been through a couple of enterprise-level
projects and can seriously evaluate and debate the various
architectures.
Separation of
concerns, and simple, crisp abstractions are what OO is all about.
Its ok to make pragmatic decisions about whether you decide to use
something like Transaction Script or Active Record, where the logic
for DB access is coupled tightly with the business logic. But if the
domain model of an OO based system, be it a web app or not, is rich
and complex, these simple examples just dont cut it. The PetShop
example is one taken purely out of context I think, from Microsofts
perspective. Their original version was horrendous from a software
development good practice perspective. Version 3 looks a lot better,
but the objects still arent crisp and there is still redundancy in the
web tier.

To be honest, I haven't looked at it since all the fuss over version 1.
 
D

David

Yes, I've read that book and I agree it's a good source for this kind
of information.

Re: Rockford Lhotka's Business Object book

It's on my soon-to-read list. Have you read his older Business Objects
books? Is there a lot of new stuff in this one, or is mostly a rehash
(in the same his VB6 book was pretty much just an update of the VB5
book).
 
S

Steve C. Orr [MVP, MCSD]

It's pretty different because OO capabilities have been brought to a whole
new level with VB.NET.
There really wasn't much difference between VB5 and VB6.
His older techniques have been thoroughly improved to take advantage of
these new OO capabilities.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://Steve.Orr.net
Hire top-notch developers at http://www.able-consulting.com
 
M

Max

Now you could come back and say you get all of this with the winforms and
code-behind. But I have spent 12 months working with a team on this type of
system, and the OO parts in the web tier have become more monolithic as the
system has become more complex.

Sounds like you're problem is project management more than anything. Here
you are ranting about your web application woes, claiming .NET is not
exactly OO, because you had some problems with winforms?? I have no clue
what you're talking about, but I'm glad I'm not in your shoes!

-M
 
M

Max

Microsoft loves that "drag & drop" -- they'd make everything a cascading
menu and drag & drop if they could...

"Configuring validation in ASP.NET can be done by simply dragging and
dropping server-side controls onto the page at design time and then setting
a few properties on the control. ASP.NET provides out-of-the-box validation
controls..."

-Max
 

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

Forum statistics

Threads
473,775
Messages
2,569,601
Members
45,182
Latest member
BettinaPol

Latest Threads

Top