Link to home
Start Free TrialLog in
Avatar of acgt
acgt

asked on

Classic Business Object OOP vs Microsoft bound controls OOP

While I have some non-professional experience in programming I have over the past few weeks attempted to upskill myself with classic OOP skills under the ASP.NET 2.0 environment. At first glance I was quite impressed with the ability to write objects that can be bound to data controls. However I soon began to struggle as, after a while, I worked out that I had been trying to combine classic OOP structures where, for example, object properties are maintained via that GET and SET structures, with Microsoft data bound structures where, as far as properties go, they are accessed outside the object (rather than as direct properties) via published datasets.

Do I need to go one way and not the other? Can anyone tell me if there is an effective way to combine these approaches? Am I thinking about it the right way? Are there any good examples of industry strength asp.net business objects that access a database (SQL Server)?  

I know my question is a bit opaque, however Im not 100% sure if I am thinking about this the right way, so any assistance would really be appreciated
Avatar of sasapopovic
sasapopovic
Flag of Serbia image

Hi acqt,

I always use Business entity classes (classic OOP classes with public properties for attributes that should be bound to ASP.NET controls). I didn't find any issues with using that approach and I never use DataSets in ASP.NET projects.
There are a number of reasons for that but one that is very important to me is exchange of data with external interfaces. For example, if you have a business entity class called User and you need to have it as a parameter in Web Service method then as far as I know, any programing language that is capable of consuming the web services will be able to handle it. On the other hand, if you use DataSets then you may find problems when you want your web services to be consumed by other platforms.

There are performance and reusability issues that I found with DataSets and even more and using custom business entity classes is more OOP approach in my oppinion.

I hope this will help you deciding on how to proceed.

Regards,
Sasa
Avatar of acgt
acgt

ASKER

Thanks for this.....

When you say you bind public properties of classic oop classes to asp.net controls, to what method do you do this. Do you do it in code behind or do you use the ObjectDataSource (as seems to be pushed on us by MS).

I've not found how to bind classic properties to controls and I cant find any examples. do you have, or know where I can find what is considered an "industry" standard example of what you are describing?


Thanks
ASKER CERTIFIED SOLUTION
Avatar of sasapopovic
sasapopovic
Flag of Serbia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial