Python Class and Object Relationship

Sdílet
Vložit
  • čas přidán 7. 07. 2024
  • Looks at the relationship between a class and object and considers how objects message each other in an object oriented program.

Komentáře • 27

  • @pascal0868
    @pascal0868 Před rokem +5

    Having watched so many vid on the subject I can conclude just because you’re a good programmer doesn’t mean you know how to teach. This teacher is real deal.

  • @andrewwebster5060
    @andrewwebster5060 Před 6 měsíci +2

    all these videos provide a clear and thorough explanation - of 'what is actually happening' !

  • @keihaasart2388
    @keihaasart2388 Před 7 lety +10

    Old video, but not out of date! Thank you for not talking to your viewers like we already know the subject. The perfect way to learn for my kind of brain that seeks the concepts of programming.

  • @mohammedshahidulislam7959

    One of the best lecturers to learn class in Python. Thank you.

  • @john-junkarsan4671
    @john-junkarsan4671 Před 5 lety +3

    EXCELLENT TEACHING! PLS MORE!

  • @havochavocduku9887
    @havochavocduku9887 Před 3 lety +1

    incredible articulation MR Jones.....you pretty good

  • @EyeIn_The_Sky
    @EyeIn_The_Sky Před 6 lety +3

    How the hell in all this time in searching and practising and going round in circles did I not stumble upon this earlier!! I just hope you have a similar video in regards to the visualisation of functions.

    • @johnphilipjones
      @johnphilipjones  Před 6 lety +1

      Have a look at the following link it has links to 12 videos on user defined functions in Python.
      www.pythonbytesize.com/user-defined-functions.html
      Regards
      Phil

  • @rita_jones
    @rita_jones Před 2 lety +1

    thank you so much for the video

  • @zachyang3816
    @zachyang3816 Před 5 lety +1

    This is what im looking for!!!

  • @elchakiboo
    @elchakiboo Před 9 lety

    Thank's for your video

  • @maxcapener
    @maxcapener Před 9 lety +2

    In case anyone finds it useful... I drew out a mirror image of the sending object --> message --> receiving object diagram. That way, it gives a nice visual that the object on the left side of the dot is the receiving object. See - imgur.com/0qjdJVe. Yes, I'm a visual learner!

  • @jvsnyc
    @jvsnyc Před 3 lety

    I am watching thru this whole playlist, it is very good. One concern that I had was that beginners are often confused about whether the code for the methods is actually inside the Object Instance or not. I remember worrying the first time I saw a brief description of Encapsulation (a long time ago!) that if there are a huge number of objects wouldn't there be a lot of copies of the instance methods? You never once say that is the case, of course, but in the Execution space diagrams showing the methods inside the circle representing the object, it might visually give that suggestion enough to bear stating just once that "it looks like the code lives in each instance of the object in these diagrams, but don't worry, there is only one copy of each method, other things are just easier to conceptualize if you look at it like this."

    • @johnphilipjones
      @johnphilipjones  Před 3 lety

      This is a good point and it has worried me. However, I am hoping the viewer realises that it is just a model view of objects. It is one very much derived from the UML design view of code (and as such is not language specific).
      Best wishes
      Phil

    • @jvsnyc
      @jvsnyc Před 3 lety

      @@johnphilipjones On places like JavaRanch/CodeRanch that attract a lot of Noobs, and discussing things with (possibly experienced) programmers totally new to OOPS I have seen people harbor that misconception many times. That I thought that myself for a day (admittedly, everything accessed with a . in C is inside your struct physically with some offset) made me cringe each time and therefore remember it.

  • @EyeIn_The_Sky
    @EyeIn_The_Sky Před 6 lety

    Would I be correct in saying that "an object is an instance of a class"? And would a useful analogy be like the Class to Object is what Chromosomes are to DNA? Kind of like an origin that has to exist (like the first cell) in order to produce more cells/divide itself?

    • @johnphilipjones
      @johnphilipjones  Před 6 lety

      Not sure about the analogy but this most probably says more about my understanding of biology. I would often use the analogy of a scone cutter and the scone. The cutter cuts out identical shaped scones. The cutter is the class and the scones are the objects. Or blueprints the blueprint is the class and the houses built from the blueprint are the objects. Have a look at the video at the following link which address the issue.
      czcams.com/video/AaIdperUu-A/video.html
      Regards
      Phil

  • @martinkaspar5095
    @martinkaspar5095 Před 5 lety +1

    hello dear John - overwhelming tutorial - very helpful. One question though can you put togehter the most important infos into a cheatsheet - a Summarizing Cheat Sheet to download would be fantastic.
    above all - keep up the great work. It rocks!

    • @johnphilipjones
      @johnphilipjones  Před 5 lety

      Thank you for your positive comments. Once the video series is complete I intend to develop supporting notes in the form of PDF files.
      Best wishes
      Phil

    • @martinkaspar5095
      @martinkaspar5095 Před 5 lety +1

      dear Phil - many thanks for the quick reply. you did a fantastic job explaining this concept! I am learning to code for the first time and was not able to fully grasp this material until
      I saw your videos covering various topics on the Python-Technique.
      Phil, i want to thank you so much for these in depth-going tutorials. Finally, I am getting to understand the concepts of classes and instances. It's very challenging before but now I can able to comprehend much of the Python-philosophy and technique. You are the best tutor! I look forward to watching more of your tutorials. - Keep up the great work!!!!! It rocks!!
      and yes: i look forward to the supporting notes!! ;)

  • @hanif2778
    @hanif2778 Před 5 lety

    hi phil thanks for this tutorial.
    i still little confuse. Is identifier_a, identifier_b, identifier_c etc derived from the same class or from different class?
    thanks for help

    • @johnphilipjones
      @johnphilipjones  Před 5 lety

      In the illustration given they are instances of different classes

  • @maxcapener
    @maxcapener Před 9 lety

    A very timely video for me! You lost me a bit at 6:58 - "we'll have objects being created, and these objects will create other objects." Earlier in the video you have shown identifier_a as having been instantiated from a Class outside of the execution space, but now instantiation of identifier_b appears to be occurring inside the execution space, and from an instance of a Class, rather than from the Class itself. This has left me rubbing my head a bit. Am I missing something? Or will this become clear in the next video?

    • @johnphilipjones
      @johnphilipjones  Před 9 lety +2

      Hello Max,
      There always has to be a first object created (or code being called from a function called main()). Once an object is in the execution space it can create other objects i.e. it will contain the code to create the other objects. - now these objects will still be an instance of a class (I have not shown this relationship in the diagram for these other objects being created). Hopefully the following videos (that I am yet to complete) will through code examples make this clear.
      Best wishes
      Phil

    • @maxcapener
      @maxcapener Před 9 lety

      Ok that makes more sense now. I think I see where you are heading with this.
      Last question for today - regarding the last half of this video - let's take something common like x.y = 3.
      If I'm not mistaken, using your past terminology this translates roughly as "the object x now contains an object reference named y that references object '3'." But in using terms like 'messages', 'receiving objects' and 'sending objects', is 3 the sending object? How would you explain x.y = 3 in the terminology introduced in this video?

    • @johnphilipjones
      @johnphilipjones  Před 9 lety

      ***** x = 3 binds the identifier x to an integer object that has the value of 3.
      z = ClassName binds the identifier z to an instance (i.e. object) of the class "ClassName".
      z.member means that there is a message being sent to the object z (i.e. the object that z is bound to.
      Phil