+ Reply to Thread
Results 1 to 2 of 2

Thread: OOP concepts

  1. #1
    Newbie HayDee is an unknown quantity at this point
    Join Date
    Mar 2010
    Posts
    1

    OOP concepts

    Hello!

    I've never used OOP beforse, so I can't understad how to design an object's class. Most tutorials are only explaining OOP syntax, but they don't explain deeper principles how to use OOP.

    For example, if I want to make a class which would list all files in some directory, should I make that class so that EVERY listed file is an instance of that class with it's own properties and methods, or should I make only one instance of that class with a constructor method, that calls listFiles method, sets curret directory propertie, etc... ?

    Hope you can share some links or book names where OOP would be explained deeper.
    Thanks.

  2. #2
    Super Moderator WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther has much to be proud of WingedPanther's Avatar
    Join Date
    Jul 2006
    Age
    37
    Posts
    12,912
    Blog Entries
    57

    Re: OOP concepts

    Unfortunately, explaining OOP is a little like explaining how to use an if statement correctly. You kind of play with examples of OOP programs for a while, and you look at other designs, or you might pick up a book of about 250 pages that will go way in depth, and one day you start getting those AHA moments.

    Looking at your example, for instance, it depends ENTIRELY on what you want done. You may have several objects, or just one that contains a list of strings, or...
    CodeCall Blog | CodeCall Wiki
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Beginning C# Objects: From Concepts to Code ebook
    By maulua in forum C# Programming
    Replies: 3
    Last Post: 02-16-2010, 12:36 PM
  2. Concepts
    By suneel_g in forum General Programming
    Replies: 2
    Last Post: 12-29-2008, 12:40 PM
  3. Replies: 7
    Last Post: 11-14-2008, 10:32 AM