Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code behind

Status
Not open for further replies.

stucker79

Technical User
Dec 7, 2004
25
US
My coworker and I got a new project from my boss today. I have only ever written small web based applications using VB.Net that I did by myself. My coworker suggested that he do the user interface and that I do the business logic layer. This all sounds fine, but isn't there a good section of code that I can't write until I have the UI and can see the names of the controls etc??
 
It would be a good idea if you agreed on the data design beforehand. Once you have this you can easily design the business layer. Simply develop classes which will update the back end database. For example write a method which will Add a Customer (name,address,postcodes), by using a sub which you pass a series of parameters to.

Without going into too much detail and writing a specification, there will always be things that will change, but its something you'll have to live with.

PS. The GUI bit is by far the easier of the two roles.



Sweep
...if it works dont mess with it
 
Thanks for your response. That helps a bit. My one other question is about my data access component. Once before I made one in which I had a dataset, sqlconnection, and all necessary data adapters for a specific database. That way I could use the component across the whole project. It seems to me that was a good idea, but when I think about it, it doesn't sound too reusable since I am still customizing the data adapters, sql conn, etc.

I suppose I could still make a generic sub such as:

Public Sub LoadData(da as sqldataadapter, ds as dataset, strTableName as string)
da.fill(ds, strTableName)
End Sub

But then I would have to call that for each data adapter separately, which I guess would be ok.

On a separate note, when I call sqldataadapter.update, does this automatically fire the associated update command?

Do you generally find it preferrable to specify stored procedures in code (sqlcommand.parameters.add...) or by doing the "configure data adapter" utility?

Along this note, does calling the update method of the data adapter do the same thing as doing for instance dataadapter.sqlupdatecommand.executenonquery?

One last question, is it preferrable to keep a dataset in page cache so that I don't have to keep refilling data adapters when I do post backs?

Thanks so much for your help!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top