Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Very newbie question on business objects
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00999237
Message ID:
00999307
Vues:
50
Thank you for your input and for the sample code. Hopefully between the tutorial and your input, I will get it.

>>
>
>That's nothing to be embarrassed about. The term 'business object' is very overloaded and its easy to get confused since almost everyone has a different implementation of a business object.
>
>A business object is just a class where you put your business logic that is unique to your solution. In .net you can create a simple business object that wraps a DataSet so it might look like this:
>
>public class Customer {
>   private DataSet _currentDataSet;
>   public DataSet getCustomer(int custID)
>   {
>      // execute a sql query that returns the current customer's data
>      _currentDataSet = ...
>      return _currentDataSet;
>   }
>   public void RaiseCreditLimit(decimal amount)
>   {
>      _currentDataSet.Tables[0].Rows[0]["CreditLimit"] += amount;
>   }
>}
>
>
>The whole point is to have a place to put behavior (business logic and rules like the RaiseCreditLimit) together with the data that it acts upon (in this case the data inside the dataset).
>
>Just remember that the DataSet is a relational thing (made up of tables, rows, and columns) and it is not an object-oriented thing so if you base your application on DataSets it will still be a relational application, not an object-oriented one.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform