This is another example that was intended to showcase Generic methods, but also illustrates the class association concept:
http://pastebin.com/w7e1Jn6J On Jan 12, 6:53 pm, Cerebrus <[email protected]> wrote: > Hi Daniela, > > I have posted an example that illustrates how to create the classes > and some sample usage at: > > http://pastebin.com/cDmwxZL9 > > I have tried to explain via comments where possible, but feel free to > ask if you have any doubts. I hope you are familiar with VB 9.0 > syntax. A couple of questions in your post remain unanswered and I try > to address them below: > > 1. What about Add/Delete? when I delete a customer shoud I delete a > budget? Don't know how to do this. > > Add, Delete are implemented in my example. When you delete a Customer > instance, associated budget instances are automatically deleted. > > 2. What about other elements in customer class like address and > contact number? > Those elements get added/deleted/modified when the Customer instance > is added/deleted/modified. > > You need to implement custom collection classes only if you are using > a version of .NET prior to 2.0 (pre-VS 2005) or the existing > collection classes do not suffice for your requirement. In this case, > I believe that the existing generic collections do suffice. > > Another point is that I have loaded data into the instances manually. > In a real-world scenario, you would load the data from database > tables. Ideally, the customer's budgets would be loaded when a > customer is created (for instance, by initiating a database call > within the Customer class constructor). > -- You received this message because you are subscribed to the Google Groups "DotNetDevelopment, VB.NET, C# .NET, ADO.NET, ASP.NET, XML, XML Web Services,.NET Remoting" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/dotnetdevelopment?hl=en?hl=en or visit the group website at http://megasolutions.net
