Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Thoughts
Message
De
27/04/2004 11:07:23
 
 
À
27/04/2004 09:42:11
John Baird
Coatesville, Pennsylvanie, États-Unis
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Divers
Thread ID:
00898135
Message ID:
00898550
Vues:
17
John,

Bob gave you a pretty good synopsis when he said:
"The bottom line, your UI never talks to an object in the data layer, just in the business layer."

But, I just wanted to add to that ... you may also want to access the data layer through a Web Service, which is what we do for all our WinForms. However, we use the Web Service methods more as a wrapper around our biz classes and the Web Services never talk directly to the data layer either, only through the biz classes.

Just my 2 cents ...

~~Bonnie



>Okay the consensus (two) have spoken. I was leaning towards option 2 and now you've swayed me in that direction. Another question.
>
>If I create a customer object with the ui, a customerbiz object and a customerdat layer that is self contained basically, does that violate this principle?
>
>
>
>>You defintely don't want scenario one because that's coupling your UI to your business layer. You don't want that for sure. The whole point of the business object is abstract all business logic away from the UI.
>>
>>You can however build a generic form class that knows something about your business object. So it could have methods like Save, Load etc. that can pre/post process operations against the business object. For example, on a Save automatically pop up error messages or ask whether you want to save etc.
>>
>>OO more than anything is about isolating logic to the appropriate object.
>>
>>+++ Rick ---
>>
>>>I am trying to determine the correct way (in the consensus) of doing the following. I am vacillating between 2 scenarios:
>>>
>>>1. Create class customer, customerData, frmCustomer, frmCustomerList. From main menu of main app instantiate customer and inside customer instantiate customerData. Have method to show forms when needed, have form function calls point to methods in customer.
>>>
>>>2. Create same classes, but have main menu instantiate form as needed, and in form class instantiate customer (which instantitates customer Data) and have function calls point to customer methods.
>>>
>>>Which would you suggest? Why?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform