Advanced VB.NET Programming - Serializing Objects with JSON

Поделиться
HTML-код
  • Опубликовано: 19 сен 2024

Комментарии • 34

  • @kevnar
    @kevnar 3 года назад +3

    Perfect! Exactly what I needed for my project. You even helped me avoid the pitfall of using the deprecated serialization methods. I was planning to do that.
    I'm assuming sub-classes of objects are automatically included in the JSON serialization, so I only have to save the parent object and everything associated with it gets saved as a package. That saves a heck of a lot of trouble. The objects in my project are monstrous trees of subclasses and sub-subclasses. I'll let you know how it all works out.

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад +2

      You're most welcome (and thanks for the idea kevnar). If you serialize an object created from a sub, sub sub class, inheritance will take care of everything for you. E.G. I created an object from an Employee class, whose parent was the Person class, I then serialized the employee object. If I had a Manager class (a type of employee), which inherited from the Employee class (a type of person), which inherited from the Person class, then I would serialize the manager object. Do let me know how it works out. :)KD

  • @rushabhbajaj310
    @rushabhbajaj310 2 года назад +3

    Bro , Dont Stop Uploading this Playlist , its really helpful , I have seen all videos from all your vb.net playlists , I want to learn more , at least tell me where i can keep learning about vb.net , any site , yt channel will be fine

  • @faithakanga
    @faithakanga Год назад +2

    Thanks for the lessons. Please make more videos about the advance programming

  • @redouanesaadouni6861
    @redouanesaadouni6861 2 года назад +2

    We need like this video, please continue

  • @renatzkigab2616
    @renatzkigab2616 2 года назад +2

    Please do more on advance topic and perhaps get into the database programming. Thanks it's a great vid.

    • @ComputerScienceLessons
      @ComputerScienceLessons  2 года назад +2

      I plan to. You might find my videos on developing a theatre booking system useful. :)KD

  • @dford0001
    @dford0001 Год назад

    Thank you for your time in putting together these videos. They have helped tremendously! I hope to see more!

  • @jtlunsford780
    @jtlunsford780 Год назад +1

    Never heard of it. Now I know how and what it's used for. And with some research, I think I can implement it if I ever need to. Thanks so much for the great vids and your expertise...JT

  • @Dotto19
    @Dotto19 3 года назад +4

    This is amazing and well executed. Very easy to understand. Thank you. . Do you have a video that explains the OOP using windows form please?

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад +3

      Thank you. This series of videos covers OOP in Visual Basic .NET
      ruclips.net/p/PLTd6ceoshprcFCsO49h2870tVzEeFpeWk
      :)KD

    • @Dotto19
      @Dotto19 3 года назад +4

      @@ComputerScienceLessons Thank you and God bless you 🙏🏾🙏🏾

    • @Dotto19
      @Dotto19 3 года назад

      @@ComputerScienceLessons This is one of the most helpful video I’ve ever watched . Do you do C# as well?

  • @MrJonnis13
    @MrJonnis13 2 года назад +1

    Thank you very much Sir for all the effort you put in that channel.
    I would like to ask, how the "ShouldSerializeSalary" method influences the serialization process. Who is calling that method and how it achieves the result.
    I am not aware of VB.NET but rather of C#. In C# we would have some attributes to mark the property that should not get serialized. The "ShouldSerializeSalary" method looks like "magic" to me

    • @goqsane
      @goqsane 2 года назад

      Yea. Great effort, but efforts should be made to deprecate VB.NET altogether. Horrible abomination.

  • @CienaGoat
    @CienaGoat 3 года назад +4

    How were you able to stop it from serializing the salary by just returning either true or false with this function you made? I don't see it being used anywhere outside of the declaration. 21:10

    • @ComputerScienceLessons
      @ComputerScienceLessons  3 года назад +1

      It comes down to the fact that the function has the name 'ShouldSerializeSalary', I guess that's what the JsonSerializer's Serialize method is looking out for. Love the channel BTW (subbed). Keep it coming :)KD

    • @CienaGoat
      @CienaGoat 3 года назад +1

      @@ComputerScienceLessons Oh ok I gotcha! So it's just like kind of the standard syntax to use in this scenario. It's like a function definition but not at the same time.

  • @davidm9442
    @davidm9442 Год назад +2

    Thank you so much good sir!

  • @chrisdaum1394
    @chrisdaum1394 Год назад

    Thank you for your efforts, I learned a lot watching your tutorials.
    With this one I have one problem...
    The JSON file is lacking the square brackets at the beginning/end of the file and the commas between the datablocks.
    I couldn´t figure out how to insert these via JsonWriter.Indentation Chars.
    You might call me stupid, so please if there´s an easy solution give me a hint... 🙂
    thanks!!

  • @ryancameron6837
    @ryancameron6837 2 года назад +2

    I'm still a little lost on why you'd need serialization when you can just use StreamWriter and Reader? Is it to organize data more effeciently?

    • @ComputerScienceLessons
      @ComputerScienceLessons  2 года назад +1

      Good question. The simple answer is that you could. Arguably JSON serialisation is well supported (by lots of different systems and programming languages), you could also argue that it's fashionable! The format of a JSON file relates well to the structure of an object (but you could of course do something similar with a text file, or XML). If you want to store object data more permanently, you should use a database.
      There is a discussion of the pros and cons of serialisation here:
      softwareengineering.stackexchange.com/questions/191269/java-serialization-advantages-and-disadvantages-use-or-avoid
      :)KD

    • @ryancameron6837
      @ryancameron6837 2 года назад +1

      @@ComputerScienceLessons Thank you so much! This helps a lot! Do you perhaps have a video link to a tutorial on storing information in databases?

  • @george27121984
    @george27121984 3 года назад +3

    Bravo

  • @mohammedal-mudhafar4602
    @mohammedal-mudhafar4602 Год назад +2

    MsgBox("Thank you so much :)_")

  • @matm4413
    @matm4413 3 года назад +2

    nice

  • @chrislambe400
    @chrislambe400 2 года назад +1

    Nice tutorial good Job. My Human Intelligence recognised 99% at least one clown and liar in the image.