I question about design in web

T

Tony Johansson

Hello!

I just wonder if there is a bad design to use sqlDataSource because when you
do you will use ado.net directly from the aspx code which is the
presentation layer.
Normally we will try to keep the database access in a separete class and not
mix database access code from the
presentation layer.

I just want to hear your opinion about this.

//Tony
 
A

Arne Vajhøj

I just wonder if there is a bad design to use sqlDataSource because when
you do you will use ado.net directly from the aspx code which is the
presentation layer.
Normally we will try to keep the database access in a separete class and
not mix database access code from the
presentation layer.

If you are working on your cats home page, then it may be OK.

If you are working on anything just slightly then it is a very
bad design and should be avoided.

Arne
 
T

Tony Johansson

One more question. What is best practice ? It it to to choose
ObjectDataSource or calling
the methods in the data access class in the normal way ?
Is it possible to say that one method is better then the other.

//Tony
 
A

Arne Vajhøj

One more question. What is best practice ? It it to to choose
ObjectDataSource or calling
the methods in the data access class in the normal way ?

I would bring a List said:
Is it possible to say that one method is better then the other.

It is not an exact science. You can certainly come up with
some options where it is not generally agreed which is best.

But other cases are more clear. Having SQL mixed with HTML
is bad. And I would say that there is general acceptance
of that today.

Arne
 

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

Top