Results 1 to 13 of 13

Thread: [RESOLVED] OOP Tutorials

  1. #1
    MonkeyMadness
    Guest

    Resolved [RESOLVED] OOP Tutorials

    I have been trying to adopt OOP techniques in VB.net but admit to being stumpted.

    Does anyone know if there are any good tutorials out there that will walk me through all th basic principles.

    However hard I try I just cant get it, but I appreciate that to improve as a developer I need to master these techniques.

    Thanks

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    No , get a book something like this one : http://www.amazon.com/exec/obidos/tg...61749?v=glance

  3. #3
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Or try asking more specific questions, What don't you get? What have you done to try? What makes you think you haven't succeed? The biggest thing about OOP is to make and not over do it just make sure all the structure makes sense.

  4. #4
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    I have a similar problem. My obstacles are using the msdn and knowing what namespaces are. (not to mention knowing what to look up! )

    I know what methods and properties and events are.

    When the object has more than two "dots", I get lost. what exactly is this called?

    These are just a FEW of the questions I have. but I'm sure this will get me in the right direction.

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Whats the question exactly? Whats a namespace? A namespace is a way to categorize related objects. The namespace is like the path to the object. Using the imports statement is like making an implied shortcut to shorten the path for the reminder of that section.

  6. #6
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    I see. You could type in the namespace everytime you need it OR you could use it at the head of the code, right?

    Here's another one: what does this statement mean?
    Code:
    Dim dir As New DirectoryInfo(ListBox1.SelectedItem.ToString)
                Dim fiTemp As FileInfo
                Dim fil As FileInfo() = dir.GetFiles()
                For Each fiTemp In fil
    here's what I DO know:

    dim dir as declares a variable named dir
    AS NEW sets it to an instance of the object DIRECTORYINFO and the (listbox1.selecteditem.tostring) is a property of that object. Am I right so far?

    dim fiTemp as fileinfo instantiates a variable named fiTemp as an object called fileinfo. Since fileinfo is an object already, it INHERITS the properties and methods of it. Right so far? one question about this though. Why don't I have to say DIM FITEMP AS NEW FILEINFO? like the previous statement?

    and the dim fil as fileinfo()...same question...why is there no AS NEW statement? and why in this statement are there parentheses after fileinfo and not in the statement before it? Then, there is the "=" sign. I'm assuming this sets the variable "fil" as an object of fileinfo and then sets it to another object of dir.getfiles. BUT dir was instatiated earlier as directory info so dir.getfiles is a method of the object "dir" ? Right? Why then, must we set so many variable?

    Am I over-analyzing this or is there some logic I'm missing?

  7. #7
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Did you try to read a book or even a tutorial that explain how OOP work in .NET ? after reading that , I'm sure you'll answer all these questions yourself and give a good logical explanation . OOP is more than the 'New' keyword . So , don't waste your time and start from now .

  8. #8
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Originally posted by thephantom

    Here's another one: what does this statement mean?
    Code:
    Dim dir As New DirectoryInfo(ListBox1.SelectedItem.ToString)
                Dim fiTemp As FileInfo
                Dim fil As FileInfo() = dir.GetFiles()
                For Each fiTemp In fil
    here's what I DO know:

    dim dir as declares a variable named dir
    AS NEW sets it to an instance of the object DIRECTORYINFO and the (listbox1.selecteditem.tostring) is a property of that object. Am I right so far? Mostly, but listbox1.selecteditem.tostring is just a value that you are passing to the DirectoryInfo method that constructs an instance of DirectyInfo.


    dim fiTemp as fileinfo instantiates a variable named fiTemp as an object called fileinfo. Since fileinfo is an object already, it INHERITS the properties and methods of it. Right so far? one question about this though. Why don't I have to say DIM FITEMP AS NEW FILEINFO? like the previous statement?
    You aren't creating an instance of the object, just a reference, so the compiler KNOWS about the type of object fiTemp is (will be) referring to.

    and the dim fil as fileinfo()...same question...why is there no AS NEW statement? and why in this statement are there parentheses after fileinfo and not in the statement before it? Then, there is the "=" sign. I'm assuming this sets the variable "fil" as an object of fileinfo and then sets it to another object of dir.getfiles. BUT dir was instatiated earlier as directory info so dir.getfiles is a method of the object "dir" ? Right? Why then, must we set so many variable?
    Again, you are creating a reference, and then setting that reference equal to an already existing value, which is dir.GetFiles(). Most strict languages requires parantheses, in VB you may find if you type dim fil as fileinfo = new dir.getfiles, you get the same result. The For Each means for each object in fil, if the type of the object is fiTemp...

    Am I over-analyzing this or is there some logic I'm missing?

    When you say Dim X As Porsche. You have created a reference of a porsche object.
    But the object does not exist yet though.
    Not until you say X=New Porsche, or X = Y (some other porsche), is there actually an object being referred to.
    Last edited by nemaroller; Dec 31st, 2003 at 09:13 AM.

  9. #9
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    Originally posted by Pirate
    Did you try to read a book or even a tutorial that explain how OOP work in .NET ? after reading that , I'm sure you'll answer all these questions yourself and give a good logical explanation . OOP is more than the 'New' keyword . So , don't waste your time and start from now .
    I JUST ordered that book you suggested above. Really, I think if I get the proper ground work laid out, the rest is downhill. I have James Foxall's book on vb 2003 and he talks about oop but I didn't really get it. Maybe it's just because I am overthinking it or maybe because it's just one authors explanation. I am the kink of person who likes to gleen off of all sorts of people. I'm not a slow learner but I ain't the fastest either!!

    What did you mean by don't waste my time and start from now?

  10. #10
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Well , it's just an advice from someone who really wants to help . I meant you buy a book and go through it and do all the exercises (if there are any) , setp by step , understand why you do this and not that . I said that because you'll spend some time to get it and be fully OO programmer . Don't take it offense , it's all about help . I've read a lot of books but at the end I realized that MS's books are good because they talk about some specific things that other books never mention . I don't know if you are like me , when I want to do something I say "I'll do it now" . Goodluck

  11. #11
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    As pirate said, MS press books are usually the most detailed. Programming Visual Basic .Net by MSPRESS is a great start.

    http://www.amazon.com/exec/obidos/tg...glance&s=books

  12. #12
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    Originally posted by Pirate
    Well , it's just an advice from someone who really wants to help . I meant you buy a book and go through it and do all the exercises (if there are any) , setp by step , understand why you do this and not that . I said that because you'll spend some time to get it and be fully OO programmer . Don't take it offense , it's all about help . I've read a lot of books but at the end I realized that MS's books are good because they talk about some specific things that other books never mention . I don't know if you are like me , when I want to do something I say "I'll do it now" . Goodluck
    absolutely no offense taken It's hard sometimes to get your expressions across in plain text. lol I ordered that book and went to look at it at my local bookstore. It looks like it will be very helpful. I am re-reading James Foxall's chapters on the subject as well. What I'd REALLY like to do is find a web-site like programmers heaven and get sample code of .net stuff and pick the code apart. Can anyone list a we-site or two?

  13. #13
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width