Eric Wise

Sponsors

The Lounge

Wicked Cool Jobs

Blogs I Read

Fun & Games

Advertisement

Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
ASP .NET Data Persistance

Ok here's an odd one.  The client has a popup screen that has a grid on it.  Under the grid is a Add/Edit/Delete collapsable control that has three buttons in it labeled 'Ok', 'Cancel', 'Delete'.  At the bottom of the screen are three more buttons labeled 'Save', 'Apply', 'Reset'.

The idea here is that users can drop open the edit control, and fill out the fields to add a row to the grid.  They can also click a row, which would load the contents of that row into the edit area, which can be modified and then update the grid with an ok click or delete the row from the grid with the delete button.  NONE of these actions will actually update the database.  Also, the edit control area generally has more fields than the grid itself as the grid just displays the summary info for the row.

Save will send all of the changes to the database and close the popup.  Apply will send all of the changes to the database but keep the popup as is.  Reset will return the popup to the initial load state.

Here comes the tricky part: They don't want to cache the dataset!

So apparently they expect me to initially bind the datagrid to a dataset, then on subsequent postbacks just create a dataitem and add it to the controls collection of the datagrid for adds.  Find and delete a dataitem for a delete.  Find and modify a dataitem for edit.  Then when the user hits a button that actually wants to hit the database I'm supposed to parse the entire datagrid dataitems and build a dataset to send to the server.

Most of the historical apps around here were windows forms.  It seems to me that they are trying to design a web application using winforms principles.  Can anyone post some thoughts on how you think this monster will perform and whether it's even feasible to attempt writing this wierd code?

I feel like this is really bad design but I am having trouble eloquently explaining this to the folks in charge.


Posted Thu, Jul 1 2004 12:59 PM by Eric Wise

[Advertisement]

Comments

Eric Wise wrote RE: ASP .NET Data Persistance
on Thu, Jul 1 2004 9:23 AM
After some initial testing, I have learned that if you add a dataitem to a datagrid programmatically it does NOT update the count property and won't let you use a for each.

I think the only way to do this is to persist the dataset, add a row to the datatable, and rebind the grid.
Jeffrey Palermo wrote re: ASP .NET Data Persistance
on Thu, Jul 1 2004 10:02 AM
It's your career. If I have a dispute with the design, it stops right there. Don't allow yourself to say" I know it's wrong, but I'm doing it anyway." I would quit first.
Eric Wise wrote RE: ASP .NET Data Persistance
on Thu, Jul 1 2004 12:36 PM
Nah, I wouldn't quit a job over a design dispute. When this kind of thing comes up I always wonder whether I'm missing something in the big picture.
Mark Bonafe wrote re: ASP .NET Data Persistance
on Fri, Jul 2 2004 2:07 AM
It must be nice to be in such a position, Jeffrey. You must work alone.

Eric - I would explain to your client that caching, whether it's a dataset or an array of some sort will *absolutely* be required to accomplish the mission. If they are so against caching datasets, perhaps you could create a type safe collection.
Eric Wise wrote ASP.NET Data Persistance Part II
on Fri, Jul 2 2004 2:09 AM
ASP.NET Data Persistance Part II
Devlicio.us