Re: OO development question...



Hi there... I am so new to OO, I am not sure what you mean by "helper"
functions in particular. What kind of a base class would I inherit from -
and where would I find one with the methods I would need - OR are you saying
that I would create my own base class to inherit from? I take it this would
have to be a VERY generic class that would just have a few properties and
these "helper" functions or methods available? My update/delete/inserts are
very specific (I call SQL Server 2000 stored procedures to do the work - not
embedded or dynamic SQL) unless the functions you are referring to are so
generic and all you do is to pass table names, fieldnames etc..etc.. to the
methods which in turn would do the inserts/updates etc..etc...

Help?

Brad

"Spam Catcher" <spamhoneypot@xxxxxxxxxx> wrote in message
news:Xns9A05A1968E521usenethoneypotrogers@xxxxxxxxxxxx
"Brad Pears" <bradp@xxxxxxxxxxxxxxxxxxxxx> wrote in
news:OYT4V4ZPIHA.1756@xxxxxxxxxxxxxxxxxxxx:

I am unsure how I should develop the business classes, whether I
should have just one business class which includes collection
properties to house the two 1-M relationships or whether I should
create three business classes (one for each table) with the high level
class containing one collection property for it's 1-M relationship
with the 2nd class and in the second class, also include a collection
property to house the 1-M relationship it is in with the 3rd class...


You should have 3 classes, for each 1->M relationship, use a collection
to house the objects.

i.e,

Parent
Property Child as List(of Child)


Child
Property GrandChild as List(of GrandChild)


GrandChild
just a bunch of properties

your parent object - you may even want to inherit from a base object so
that you can put in generic helper functions (i.e. Save to Database,
Delete, etc.)

You should also take a look at LLBLGen Pro and Typed Datasets - LLBLGen
Pro is a OR Mapper which does this sort of mapping for you. Typed
Dataset is a VS.NET feature which does something similar but is MUCH
more primative ;-)


--
spamhoneypot@xxxxxxxxxx (Do not e-mail)


.



Relevant Pages

  • Re: Abstract Class Theory
    ... >> there would be no need for abstract methods, and no abstract classes. ... >> the derived class will be overriding, or even overloading, the base class ... > class inherit from both. ... Actually you are confusing abstract classes and interfaces. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Abstract Class Theory
    ... > the derived class will be overriding, or even overloading, the base class ... If you read into the Patterns literature, you can see that the requirement ... In addition, if you define two abstract classes, you can have a concrete ... class inherit from both. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: What the diff between a virtual method and an inheirited method
    ... To inherit a method from a base class defined as virtual is ... > to allow the derived classes to define their own unique ... functional programming, and believe me it will make you a better ...
    (comp.lang.cpp)
  • Re: Visual Studio 2003, CollectionBase.RemoveAt Method
    ... You don't think of it as such because Microsoft also hid the ... The VB Collection class does not inherit System.Collections.CollectionBase. ... you must explicitly define a "RemoveAt" method in order to ... you can't hide anything in a derived class from a base class. ...
    (microsoft.public.vsnet.general)
  • Re: Dynamic class creation at runtime
    ... dinamically a new type that inherit directly from the base class. ... I have in my assembly the base class and 2 inherited classes: ... >> classes for each single algorithm. ... >> dynamic definition of Assemblies, but I do not want to create a new Assembly, ...
    (microsoft.public.dotnet.framework.clr)