none
when to use classes RRS feed

Answers

  • Hello,

    From my understanding, we should always use classes if we are using C#.

    The principles behind OOP say more or less that you should split stuff up as much as possible so that related things are grouped together in their own class.Often used example is that of a car - if we need to deal with the data of cars, you would make a car class containing relevant variables like top speed, name, colour and appropriate methods like for example drive(double distance) or something like that.

    This is a very short and very rough description. I suggest to have a look at the articles below to that topic.

    http://www.codeproject.com/Articles/22769/Introduction-to-Object-Oriented-Programming-Concep

    If I have misunderstood, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 14, 2013 7:57 AM
    Moderator

All replies

  • Hello,

    From my understanding, we should always use classes if we are using C#.

    The principles behind OOP say more or less that you should split stuff up as much as possible so that related things are grouped together in their own class.Often used example is that of a car - if we need to deal with the data of cars, you would make a car class containing relevant variables like top speed, name, colour and appropriate methods like for example drive(double distance) or something like that.

    This is a very short and very rough description. I suggest to have a look at the articles below to that topic.

    http://www.codeproject.com/Articles/22769/Introduction-to-Object-Oriented-Programming-Concep

    If I have misunderstood, please let me know.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, November 14, 2013 7:57 AM
    Moderator
  • Hi,

    practically do you understand what is type Book? Are you able to differenciate between object of Book & object of Toy?

    I guess yes.

    Think practically in your programming life. When you sit before your computer to do some programming just be cool and think of objects as you know in your real life.

    .NET Framework starts with a small object. That object is 'Object' class.

    This is just like our universe that erupted from a Single point at Big Bang.

    Think Practically.


    One good question is equivalent to ten best answers.

    Friday, November 15, 2013 12:12 PM
  • It is the basic concept of OOP.

    Refer this http://msdn.microsoft.com/en-us/library/vstudio/dd460654.aspx .

    Friday, November 15, 2013 12:18 PM