Class VS Components

Discussion in 'ASP .Net' started by Guest, Jan 29, 2004.

  1. Guest

    Guest Guest

    In ASP.NET if am writing a class for Datalayer ,

    Public Class XXX{
    // I am createing a class file and write all database activity methods there
    }


    OR

    public class XXX : System.ComponentModel.Component{

    // I am Creating a component and write all all database activity methods there
    }

    What is the difference?
    The only difference i find is in the second case class inherits some class. and i can drag and drop data controls,
    which otherwise in the first case i have to write manually.

    Can someone guide me the technical difference and which approach i should take.


    Regards,
     
    Guest, Jan 29, 2004
    #1
    1. Advertising

  2. The following article should be helpful:

    http://msdn.microsoft.com/library/d...guide/html/cpconclassvscomponentvscontrol.asp

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    <Jignesh> wrote in message news:...

    In ASP.NET if am writing a class for Datalayer ,

    Public Class XXX{
    // I am createing a class file and write all database activity
    methods there
    }


    OR

    public class XXX : System.ComponentModel.Component{

    // I am Creating a component and write all all database activity methods
    there
    }

    What is the difference?
    The only difference i find is in the second case class inherits some class.
    and i can drag and drop data controls,
    which otherwise in the first case i have to write manually.

    Can someone guide me the technical difference and which approach i should
    take.


    Regards,
     
    Kevin Spencer, Jan 29, 2004
    #2
    1. Advertising

  3. Guest

    Jignesh Guest

    Thanks for the link but i could not make a decision.

    Actually i have seen people developing web application using "Add componets"
    menu for DAL(Data Access Layer). I just wanted to know is that right

    bcos as such the only diff between the two is that the other just inherits
    System.ComponentModel.Component

    and its allows me to drag and drop data controls like (ds, adaptor etc)



    "Kevin Spencer" <> wrote in message
    news:%...
    > The following article should be helpful:
    >
    >

    http://msdn.microsoft.com/library/d...guide/html/cpconclassvscomponentvscontrol.asp
    >
    > --
    > HTH,
    > Kevin Spencer
    > .Net Developer
    > Microsoft MVP
    > Big things are made up
    > of lots of little things.
    >
    > <Jignesh> wrote in message news:...
    >
    > In ASP.NET if am writing a class for Datalayer ,
    >
    > Public Class XXX{
    > // I am createing a class file and write all database activity
    > methods there
    > }
    >
    >
    > OR
    >
    > public class XXX : System.ComponentModel.Component{
    >
    > // I am Creating a component and write all all database activity methods
    > there
    > }
    >
    > What is the difference?
    > The only difference i find is in the second case class inherits some

    class.
    > and i can drag and drop data controls,
    > which otherwise in the first case i have to write manually.
    >
    > Can someone guide me the technical difference and which approach i should
    > take.
    >
    >
    > Regards,
    >
    >
     
    Jignesh, Jan 30, 2004
    #3
  4. It isn't a matter of which one is "better." It's a matter of which one is
    the appropriate tool for your particular job. The article tells you when to
    use one and when to use the other.

    --
    HTH,
    Kevin Spencer
    ..Net Developer
    Microsoft MVP
    Big things are made up
    of lots of little things.

    "Jignesh" <> wrote in message
    news:...
    >
    > Thanks for the link but i could not make a decision.
    >
    > Actually i have seen people developing web application using "Add

    componets"
    > menu for DAL(Data Access Layer). I just wanted to know is that right
    >
    > bcos as such the only diff between the two is that the other just inherits
    > System.ComponentModel.Component
    >
    > and its allows me to drag and drop data controls like (ds, adaptor etc)
    >
    >
    >
    > "Kevin Spencer" <> wrote in message
    > news:%...
    > > The following article should be helpful:
    > >
    > >

    >

    http://msdn.microsoft.com/library/d...guide/html/cpconclassvscomponentvscontrol.asp
    > >
    > > --
    > > HTH,
    > > Kevin Spencer
    > > .Net Developer
    > > Microsoft MVP
    > > Big things are made up
    > > of lots of little things.
    > >
    > > <Jignesh> wrote in message news:...
    > >
    > > In ASP.NET if am writing a class for Datalayer ,
    > >
    > > Public Class XXX{
    > > // I am createing a class file and write all database

    activity
    > > methods there
    > > }
    > >
    > >
    > > OR
    > >
    > > public class XXX : System.ComponentModel.Component{
    > >
    > > // I am Creating a component and write all all database activity methods
    > > there
    > > }
    > >
    > > What is the difference?
    > > The only difference i find is in the second case class inherits some

    > class.
    > > and i can drag and drop data controls,
    > > which otherwise in the first case i have to write manually.
    > >
    > > Can someone guide me the technical difference and which approach i

    should
    > > take.
    > >
    > >
    > > Regards,
    > >
    > >

    >
    >
     
    Kevin Spencer, Jan 30, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mickey Segal
    Replies:
    0
    Views:
    923
    Mickey Segal
    Feb 2, 2004
  2. sai
    Replies:
    3
    Views:
    339
    Thomas Fritsch
    Aug 19, 2005
  3. E11
    Replies:
    1
    Views:
    4,896
    Thomas Weidenfeller
    Oct 12, 2005
  4. Michael Andersson
    Replies:
    0
    Views:
    468
    Michael Andersson
    May 2, 2005
  5. christopher diggins
    Replies:
    16
    Views:
    774
    Pete Becker
    May 4, 2005
Loading...

Share This Page