Click here to Skip to main content
Click here to Skip to main content

Object-Oriented ASP.NET

By , 10 Aug 2003
 

Introduction

ASP.NET brings a whole new world of functionality, power, and ease of rapid development for web programmers. Some of these features, such as the advent of code-behind, are well documented and have become standard practice in everyday development. Another feature ASP.NET brings us is development with a real, compiled language. We can now leverage the object-oriented aspects of these new languages and put them to work in our code. We can take advantage of inheritance, polymorphism, and encapsulation when writing web apps while still maintaining an Microsoft DNA-style n-tier architecture.

I'm not going to try to explain these OO design concepts because they are already the subject of a great many articles (and books). For example, you could try this article right here on CP for an introduction.

I will be showing a simple example of how you can use inheritance and encapsulation in ASP.NET. I will show how you can customize a datagrid by encapsulating some behavior in a subclass of the datagrid, and thereby making the derived DataGrid class re-usable across multiple forms or applications. I'll be using C# for this example, but the same principles apply to VB.NET.

A Real-World Example

For this example I will be using a common scenario developers encounter with the DataGrid. The DataGrid gives us some powerful pre-built column objects, including command columns which allow the user to press buttons (or links) to select, edit, or delete items in the grid. Imagine you are writing a web form which uses a DataGrid having a "Delete" column, and you want to make the user confirm the deletion before actually deleting the item.

This is accomplished by using some client-side javascript to invoke the confirm function in the onclick handler:

<... onclick="return confirm('Are you sure?');" >
The way that you attach this code to the Delete button is to add to the item's Attributes collection when the item is created:
Control.Attributes.Add("onclick", "return confirm('Are you sure?')");
You will typically find code like this in the Page class which is handling the OnItemCreated event of the grid. It usually goes something like this:
private void InitializeComponent()
{
  this.grid.ItemCreated += 
    new System.Web.UI.WebControls.DataGridItemEventHandler(
    this.OnItemCreated);
  // ...(other handlers)...
}

private void OnItemCreated(object sender, 
  System.Web.UI.WebControls.DataGridItemEventArgs e)
{
  if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == 
       ListItemType.AlternatingItem)
  {
    Button btn = e.Item.FindControl("delbutton");
    btn.Attributes.Add("onclick", "return confirm('Are you sure?')");
  }
}

I find this approach to be flawed for two reasons:

  1. Encapsulation is being violated. Why is it the job for the Page object to fiddle around with the internal attributes of the datagrid? It would be ideal if the page object could simply set a boolean property to enable the confirmation message box.
  2. If you want to have delete confirmations for all 5 grids in all 5 pages of your application, you are going to have to repeat at least some of this code 5 times in your page classes. You can try to work around this by sharing some common code, but you still have to hook up an event handler for each grid in each page's InitializeComponent.

A Better Way

We will derive a new class from DataGrid, called ConfirmDelDataGrid. The derived class will internally handle the code to attach the javascript attributes. In order to take advantage of deletion confirmation, the page class merely has to create an instance of ConfirmDelDataGrid and do nothing else.

Creating a Derived DataGrid

To create the new customized DataGrid, right click on your project in the Class View and select "Add... Class". You must be in the class view! If you try this in the solution explorer, you can only add generic classes to your project. Type a class name and then switch to the Base Class panel. Select the DataGrid as your base class, like this:

Creating a DataGrid subclass

Once you have added your new derived class, we will go about customizing the behavior. First we need a way to determine which column is the Delete column in the grid. One approach is to override the DataGrid's CreateColumnSet method and examine the columns as they are created:
// Class member that stores the index of the "Delete" column of this grid
protected int delcol = -1;

protected override ArrayList CreateColumnSet(PagedDataSource dataSource, 
  bool useDataSource)
{
  // Let the DataGrid create the columns
  ArrayList list = base.CreateColumnSet (dataSource, useDataSource);

  // Examine the columns
  delcol=0;
  foreach (DataGridColumn col in list)
  {
    // If this column is the "Delete" button command column...
    if ((col is ButtonColumn) && 
        (((ButtonColumn)col).CommandName == "Delete"))
    {
      // Found it
      break;
    }

    delcol++;
  }

  // If we did not find a delete column, invalidate the index
  if (delcol == list.Count) delcol = -1;

  // Done
  return list;
}

By overriding the CreateColumnSet method we get a chance to examine the columns right after they are created by the DataGrid base class. We figure out which column (if any) is the "Delete" column and store that index in a protected member variable.

Next we will override the OnItemDataBound method of the DataGrid base class. First we let the DataGrid bind the item, then we attach the javascript to the delete column (if any):

// Property to enable/disable deletion confirmation
protected bool confirmdel = true;
public bool ConfirmOnDelete 
{ 
  get { return confirmdel; } 
  set { confirmdel = value; } 
}

protected override void OnItemDataBound(DataGridItemEventArgs e)
{
  // Create it first in the DataGrid
  base.OnItemDataBound (e);

  // Attach javascript confirmation to the delete button
  if ((confirmdel) && (delcol != -1))
  {
    e.Item.Cells[delcol].Attributes.Add("onclick", 
          "return confirm('Are you sure?')");
  }
}

So that is the code internal to the DataGrid. Notice that the new behavior is built-in to the class and a Page object who uses the class does not need to do anything to enable the deletion confirmation message box.

Putting it All Together

Now comes the beautiful part. Once we have created our derived DataGrid class called ConfirmDelDataGrid, using it and leveraging its new built-in functionality is a snap. First, add a @Register tag on the .aspx page to register the datagrid class and use it rather than <asp:DataGrid>:
<%@ Register tagprefix="dg" Namespace="ooaspnet" Assembly="ooaspnet" %>
<!-- (page layout & design here)... -->
<dg:ConfirmDelDataGrid id="grid" runat="server" ..... >
<dg:ConfirmDelDataGrid>

You'll also need to set the code-behind in your .cs file to use the new derived class:

protected ConfirmDelDataGrid grid;

private void Page_Load(object sender, System.EventArgs e)
{
  if (!IsPostBack)
  {
    grid.ConfirmOnDelete = true;
    grid.DataSource = new string[4] { "red", "green", "blue", "purple" };
    grid.DataBind();
  }
}

This is as simple as it gets. We have a new DataGrid subclass with a property that lets us automatically add confirmation message boxes, without knowing (or caring) at the Page level how it works.

Also, if we ever decide to improve the code for attaching the javascript, we can just modify the code inside the ConfirmDelDataGrid class once. Every page that uses this class will automatically benefit from the changes.

Conclusion

Programming ASP.NET allows us to take advantage of the powerful features of the underlying languages that we use. We can use object-oriented design features such as inheritance and encapsulation to develop re-usable classes that work autonomously and do not require glue code on the Page objects.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Los Guapos
Web Developer
United States United States
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralAn easy way to bind 'DELETE confirmation message' to .NET controlsgroupelizas17 Feb '10 - 1:38 
Here we have a function The 'ConfirmDelete()' which is executed each time a click event occurs on the page.
2. Then we use a logic that to find which element was clicked on i.s we append a word 'DELETE' to the ID of the control.
3.And finally check if the clicked element having ID is 'DELETED' , then the javascript function will be execute to ask the user about his/her confirmation.

JavaScript code:

function ConfirmDelete(e)
{
var targ;

if (!e)
{
var e = window.event;
}
targ = (e.target) ? e.target : e.srcElement;

if (targ.nodeType == 3)
{
targ = targ.parentNode;
}

if (targ.id.toLowerCase().indexOf("delete") >= 0)
{
return confirm("Do you want to delete this item?");
}
routeEvent(e);
}
document.onclick = ConfirmDelete;

aspx code:
 
<asp:GridView RunAt="server" ID="gvTest" DataSourceID="SqlDataSource1">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<asp:LinkButton runat="server"
ID="DeleteMe" Text="Delete" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Hope this would add on to the discussion.
http://www.mindfiresolutions.com/An-easy-way-to-bind-DELETE-confirmation-message-to-NET-controls-582.php[^]
Cheers,
Eliza

GeneralData Entry Formsmemberrizee_k15 Aug '05 - 9:59 
Hi
I need to developed dataentry forms in Asp.net using oracle database
if any one can help plz send me this little application for help
thanks
syd
GeneralCustom DatagridmemberMichael Sync7 Dec '04 - 15:50 
Hi,
 
I really need to use custom datagrid web component[asp.net] in my assignment.
That grid will be provided as the following feature~
1. Custom Filter.
Eg: There are so many invoice in datagrid.
I want to look the invoices that amount less than $1000.
As soon as I select <$1000 combo box in invoice amount header column,that grid will be product the result that less than $1000.
2. Print [ Only the result displayed in grid ].
 
That's all.
Thank you.
If you know something about that, pls mail me as soon as possible.
Thnx again.
 
Best Regard,
Michael
Generalgetting at the datagrid itemssusstristian23 Nov '04 - 5:30 
hi,
 
i added this to the class...
 
public string CheckCommandCode
{
     get { return sCommandSelected; }
     set { sCommandSelected = value; }
}
 
protected override void OnEditCommand(DataGridCommandEventArgs e)
{
     base.OnEditCommand (e);
     //e.Item.Cells.Count.ToString();   //ok shows the number of items!!
     CheckCommandCode = e.Item.Cells[0].Text.ToString();
}
 
i am trying to get at the items data, am i along the right lines??
 
thanks
tristian of london Dead | X|

GeneralProblem with multible Submit Buttons in One formmemberdhanekula24 May '04 - 2:30 
Hi,
 
Can anybody help me with regarding this.
 
I have one asp.net page on that i have 2 submit buttons and 2 textboxes.
For these 2 submit buttons i have 2 different blocks of code. When click enter on one textbox one submit button has execute and if i enter on another textbox another submit button has to execute. But for me now when ever i enter on any textbox first submit button only executing.
 
Thanks,
venubabu.
Generalthe active schema doesn not supportmemberctcraig17 Sep '03 - 5:36 
After adding the class and setting the @Register tag and using my new <dg:dgconfirmdelete id="_courseDataGrid" runat="server" tag, I am getting a slew (tech terms!) of the active schema does not support(anything associated with the grid).
 
Should I care?
Thanks
 
Chuck Craig
GeneralA sound framework lowers business costs - bring on OOmemberapeterson20 Aug '03 - 2:57 
I agree. This is very insightful. And I'd like to thank Greg, and everyone else who has written articles for their time and effort. And wik – thanks for presenting a real world question back to rh2001 - apparently, in the face of actually taking a stand – he ran for the hills.
 
My background oscillates between pure business (Director, VP, etc) and technology, so I have seen these issues from both sides. I can tell you that if you are constantly doing quick one-offs, search and paste is the way to go. BUT, if you are looking to the future, and trying to build a sound and consistent application framework within your company - this is the way to go. With a consistent user interface, and hopefully a well designed interface, the end users have a lower learning curve – translation – lower costs. If a bug does occur, it can be fixed once. With search and replace, bug fixes are ‘search, replace and pray’. Intelligent business leaders know that every structure needs a sound foundation – in this case the development framework.

GeneralI have a question please...memberprofoundwhispers19 Aug '03 - 4:17 
How did you get to know all this info when there is no source code for the .NET class library? Like for example, you obviously know how the Datagrid CreateColumnSet function works exactly, or you wouldn't have known what to override in the first place?
 
In other words, please tell me a path to follow in order to understand how the class library works exactly, so that, if I want to derive my own classes, I wouldn't be at loss, and have to search the internet for someone who did it before... Why can't I be the first to do it?!
 
Thank you very much.
 
Sammy
 
"A good friend, is like a good book: the inside is better than the cover..."
GeneralRe: I have a question please...memberCBoland19 Aug '03 - 4:56 
The SDK docs are my #1 source for technical information. I think it's the best documentation MS has written for any of their products (that I've read, anyway).
 
The source code for the Framework is available (at least the reverse-engineered MSIL code is) by using Anakrino. This little gem converts un-obfuscated MSIL code back into C# or C++ code. I've used it many times to find out how a Framework class works. You can get it here:
http://www.saurik.com/net/exemplar/

GeneralRe: I have a question please...sussAnonymous19 Aug '03 - 8:39 
http://hosca.com/rotor
Smile | :)
GeneralRe: I have a question please...memberGreg Ennis19 Aug '03 - 11:26 
Thats a good question. In this case I just took a look at the protected overrides in the class and found one that applied well for my uses. You are right that the function is not documented and I had never heard of CreateColumnSet before writing that code.
 

GeneralAnother Silly OOP Purist and Fanatic Examplememberrh200113 Aug '03 - 1:25 
Ok, that's it. This is totally nonsense and OVERLY OOP.
 
Let's take a look at that REAL WORLD EXAMPLE of 5 pages with 5 datagrids.
 
Just how much time and money did you save by using OOP in this situation? I could have easily done a "SEARCH and REPLACE" in a tenth of the time you took to "FIGURE" out the object model.
 
Second, are each of the 5 pages going to be exactly the same and need the same features?
 
Third, YOUR ENCAPSULATION reasoning is TOTALLY FLAWED in the REAL WORLD. People, READ USERS, look at WEB PAGES, not objects. By tying your new Delete oop inherited method/class to all these pages, you also make it a lot harder to CORRECT mistakes while maintaining it a "FEW MONTHS" from now. WHY IS THIS SO? Because you made something SIMPLE, more COMPLEX and SCATTERED.
 
WHAT THEY DON'T SAY ON THE OOP MAINTENACE ADVANTAGE
This OOP maintenance advantage of making a single change doesn't work in the REAL WORLD, because you take 2 hours of even days to "re-familiarize" yourself with this modified and complex object model to make this 2 second change that never comes about. Plus, you have to check if anything else didn't break as well in the other 4 pages. so much for that 2 second change.
 

 
YOUR SO called ENCAPSULATION is NOW a SINGLE POINT OF FAILURE for all of those 5 web pages!!!
In the REAL world, one CANNOT predict if and how the business requirements will change and so some pages will not need this, or some pages will need more OR in reality "who knows what".
 
Let's put your OOP sillyness to the test in the REAL WORLD and do an ROI on it as well. I say, by the time your expensive OOP programmer has figured out and re-understands the object model that HE FORGOT a month ago, My average NON-OOP programmer, has already made the change not only to 5 pages but to say 50 pages via search and replace...and best of all, he can see which pages were changed. YOur oop programmer, still has to compile and RE-TEST the entire application because it broke the "if it works, don't mess with it" rule.
 
OOP is not the only tool and is NOT always the best tool to make global changes.
 
THIS FULLY OOP solution is just like the stupid newbie progammer fanactics who build fully normalized databases.
 
If your OOP was so GOOD, why does Microsoft with its 50,000 employees still have bugs in its programs and constant almost daily updates.
 
WHERE is THAT OOP ENCAPSULATION when those SERVICE PACKS come OUT and when installed starts to break things that were previously fixed? Or adds new bugs to the system.
 
WARNING:
I got plenty more examples, news articles and just HARD HITTING and PURE LOGIC to put these OOP fanatics in their place.
 


GeneralRe: Another Silly OOP Purist and Fanatic ExamplememberGreg Ennis13 Aug '03 - 1:34 
Nice troll. If you think OO is silly then I suggest you take up the argument with someone like Bjarne Stroustrup. You appear to be about 10 years old, so you probably don't even know who he is anyway.
GeneralBjarne Stroustrup != GODmemberrh200113 Aug '03 - 10:18 
Bjarne Stroustrup != GOD
 
But for you, it seems he is?
 
Let's take a look at the TRACK RECORD OF OO IMPLEMENTATION....should we go there???
 
How does this go?
 
It doesn't work.
Blame the programmer. He didn't follow OOP principles.
 
It doesn't work.
Blame the programmer. He doesn't know design patterns.
 
It doesn't work.
Blame the programmer. He needs more and more time to design it from the ground up correctly.
 
It doesn't work.
Blame the programmer. He DID follow good OOP principles, but it was a glitch.
 
It doesn't work.
Blame the programmer. You need to understand, this ERP thing is really complex but we have OOP to help us. But just remember, there are going to be bugs with OOP and ERP like anything else.
 

STOP.
 
"bugs like anything else!!!!" Well why can't we use something else that's BETTER than OOP??
 

 
The original post warned you of the consequences of replying.
Had enough?
There is plenty more.....I am just waiting for you to say some more OOP techno babble so I can pounce on it...It's not that easy to pounce on someone who's only rebuttal is, "Troll, Troll, Troll"
 

 

 

GeneralRe: Bjarne Stroustrup != GODmemberGreg Ennis13 Aug '03 - 11:26 
Thank you for making me laugh. You are a very entertaining troll.

GeneralRe: Bjarne Stroustrup != GODmemberrh200113 Aug '03 - 11:52 
Comedians will tell you that, in order to use humour, there has to be some sort of truth within the humour.......
 
Since you, as well as others, are laughing SOOO hard, there must be a lot of truth here then.
 
Ha Ha Ha Ha....
GeneralRe: Bjarne Stroustrup != GODmemberMammaMu19 Aug '03 - 11:11 
Oh please, just because you dont know how to use OO properly dont flame on the people who do. The procedural code from old legacy VB6 components is a friggin' nightmare to to alter (in case you need that extra method that supports that new column in the db).
 
Not to say that OO programming can be messy, it can, but doing it the Bjarne Stroustrup way (the correct way) easily helps the development process a lot, not only in speed but in debugging and maintenance. In small snippets of code, procedural might be faster than real OO but I hope your not pro procedural programming in complex aplications, thats just silly.
 
In other notes:
1) please don't use that many CAPS, it makes you seem younger that you are (or are you < 15years old?).
 
2) you dont really seem like a nice guy from your posts, Keep it civil. expressions like "Ha Ha Ha Ha.... " doesnt bring the debate forward but rather makes you seem like a jerk.
 
dummy
GeneralRe: Another Silly OOP Purist and Fanatic Examplemembercas413 Aug '03 - 2:26 
Did your mother drop you on your head right before you blasted Greg? These examples aren't necessarily meant to be real world examples. They're meant to give you a starting point on a topic so you can use it in *your* real world. rh2001, do us all a favor and go crawl back under your rock!
Greg, nice article. It opens up a lot of possibilities on extending existing Objects.
GeneralRe: Another Silly OOP Purist and Fanatic ExamplememberWittnezZ (Claus Witt)13 Aug '03 - 3:11 
You apparantly did not understand the article. Your background is probably VBscript and ASP. Mine was too. And the road to learn OOP has been a long and hard, but it has surely helped me in the end. Nice article!!! No doubt!
GeneralDear OOP Fanatics, OOP != Holy Grail ; Comprende?memberrh200113 Aug '03 - 10:04 
Hey OOP mind numb robots who are drunk on their own OOP arrogance!
 
IF you are so smart why don't you have the GUTS to point out "EXACTLY" what wrong with my arguments?
 
All you can say, Troll, troll, troll...name calling, name calling, name calling, etc.
 
You just got your A** kicked, plain and simple.
 
You know nothing about *TRUE and PRACTICAL* encapsulation. And you haven't the guts to admit that OOP has serious limitations and OOP track record in the real world is like or worse than C++
 
If you need 24/7 OOP expert to program and maintain your code 365 days of the year, then that shows your something is wrong with the code, not the programmer or even the newbie....
 
Had the thought ever occurred to you that OOP could NOT be the HOLY GRAIL?
GeneralRe: Dear OOP Fanatics, OOP != Holy Grail ; Comprende?sussAnonymous13 Aug '03 - 19:31 
What are you whining about? If you don't want to use OOP then don't... what's ur f***ing problem anyway?
GeneralRe: Dear OOP Fanatics, OOP != Holy Grail ; Comprende?memberrh200113 Aug '03 - 22:02 
Who is really whining????
 
The CUSTOMER is whining, nit wit!!!
 
Do you know why companies are going overseas? Cause they can the same buggy ERP and CRM OOP programs and programmers as at a tenth of the cost.
 
Have American programmer in OOP delivered the goods? NO NO NO NO..... all OOP programmers do is say, we need more time and it's really complicated and we blame you Mr. Customer for not knowing what you want in the first place.
 
THE CUSTOMER:
Well, since I don't know what I want, I might as well pay 1/10 of the price until I do...what have I got to lose...the quality is just as crappy in America as it is in India...so why should I pay full price for crappy software. then...
 

 
HAD ENOUGH????
GeneralOO != Grail? Then what, pray tell...memberwik18 Aug '03 - 16:55 
Just out of base curiosity... since OO seems to cause you such pain...
 
Let's put you in a real world scenario. This is exactly the information I had when I started the REAL project listed below (can't mention 3rd party app for legal reasons.) What do you recommend for RAD? Which programming language should I use when I have the following application requirements:
 
- Read in and parse through 30k of XML customer data (generated from 3rd party app, so lets not get in on my storage mechanisms). Must not only read in customer data, but dynamically generate field lists (no DTD or XSD available) for information display from xml file schema and attribute/element names.
 
- Display customer data in easily readable format.
 
- Allow for sorting and filtering of said customer data using dynamically generated file/attribute lists to create smaller customer lists.
 
- Do Mass Mail Merge through program (in this case, MS Word) using said filtered customer data and pre-existing mail-merge field names (match names to closest existing attribute name from xml file)
 
- Save information on mail-merge for future examination in Excel worksheet.
 
- Update 3rd party application to reflect mail merge action through 3rd party web services.
 
- Do it all in 2 weeks.
 
- Go.
 
So... I did this last month. By myself. Had 2 weeks. Had to choose technology, programming language, and put it all in an idiot-proof UI, and oh - make sure it operated on all OS ( >= win98 ) and MS Word 97 and up. Develop. Test. Package, deploy. 2 weeks.
 
Shall I use... Scheme? LISP? What non-OO language do you suggest? This - my uninformed, caffine-laiden friend - is the REAL world, not a programmer fantasy world. RAD is not just some techie keyword, it's my daily life. And this was a small project.
 
So. Go ahead. What should I have used? (BTW, I used .NET 1.1 and VS.NET 2k3, C#, Win32, and nice installer with .NET Framework boostrap installer, and of course mad interops to MS Office...)

GeneralRe: Another Silly OOP Purist and Fanatic ExamplememberWilco B.16 Aug '03 - 2:40 
rh2001 wrote:
Just how much time and money did you save by using OOP in this situation? I could have easily done a "SEARCH and REPLACE" in a tenth of the time you took to "FIGURE" out the object model.
 
Obviously your lack of knowledge prevents you from seeing how you could build an elegant solution which is maintainable by pretty much everyone. I don't see search&replace as maintainable really.
 
rh2001 wrote:
Third, YOUR ENCAPSULATION reasoning is TOTALLY FLAWED in the REAL WORLD. People, READ USERS, look at WEB PAGES, not objects. By tying your new Delete oop inherited method/class to all these pages, you also make it a lot harder to CORRECT mistakes while maintaining it a "FEW MONTHS" from now. WHY IS THIS SO? Because you made something SIMPLE, more COMPLEX and SCATTERED.
 
If you do it right, you wouldn't have to change everything as you think. Besides, who cares if the end user can 'see objects' or not? I bet the poor guys who would ever have to maintain your code _would_ care.
 
rh2001 wrote:
Let's put your OOP sillyness to the test in the REAL WORLD and do an ROI on it as well. I say, by the time your expensive OOP programmer has figured out and re-understands the object model that HE FORGOT a month ago, My average NON-OOP programmer, has already made the change not only to 5 pages but to say 50 pages via search and replace...and best of all, he can see which pages were changed. YOur oop programmer, still has to compile and RE-TEST the entire application because it broke the "if it works, don't mess with it" rule.
 
(Wow, thank god, for a second I thought you were actually writing code, *phew*.) Are you sure you've hired the right people, and not Joe the handyman who's living next door? Obviously if you get it (OOP) right, your argument makes zero sense.
Besides, you could have a shared assembly which provides (base) functionality and is shared over those 5, 50 or 500 pages. If you prefer replacing all your crap with your (or your hired guy's) "search&replace"-skills to modifying a single piece of logic, then I think your hired guy should find himself some other occupation.
 
rh2001 wrote:
OOP is not the only tool and is NOT always the best tool to make global changes.
 
You're right. There's also the "Search&Replace" tool.
 
rh2001 wrote:
THIS FULLY OOP solution is just like the stupid newbie progammer fanactics who build fully normalized databases.
 
Could you edit your comments, search for offensive objects, and replace them with something more nice to atleast the person who took the time to write this article?
 
rh2001 wrote:
If your OOP was so GOOD, why does Microsoft with its 50,000 employees still have bugs in its programs and constant almost daily updates
 
You know there's people in that "REAL WORLD", who actually build complex applications, where the "Search&Replace"-tool of you is not applicable? I seriously doubt you do.
 
rh2001 wrote:
WARNING:
I got plenty more examples, news articles and just HARD HITTING and PURE LOGIC to put these OOP fanatics in their place.

 
If you would just find your way out to the library or places with resources which may offer people like you some help...
GeneralRe: Another Silly OOP Purist and Fanatic ExamplememberOskar Austegard18 Aug '03 - 13:19 
Ok - rh2001 is obnoxious, and he spews so much vitriol that it's hard to NOT take a defensive stance against what he says.
 
But unfortunately there is a point to take under all the capslocked outbursts: OOP is not always cost effective.
 
Small building blocks, like masked textboxes, commonly used search interfaces, data access layers and the like benefit tremendously from the reusability and extensibility of OOP. But some people tend to take things too far and make everything, including complex grids, general and abstract, just in case someone down the road might have some use for it later.
 
Even the point about normalization of dbs has some truth to it - and I'm a db purist. At some point you have to make a decision as to what makes the most sense: some repeated code/data in the interest in RAD and coding simplicity, or additional obscurity and code complexity in the interest of cleanliness and run-time efficiency.
 
Oskar Austegard

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 11 Aug 2003
Article Copyright 2003 by Los Guapos
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid