Join Dylan Israel for an in-depth discussion in this video Solution: Encapsulation, part of TypeScript: Object-Oriented Programming.
(upbeat music) … - [Instructor] The read only property is perfect for an ID. … And considering step three is all about being explicit, … I think a public read only ID would make sense. … And to be explicit, why be explicit? … Well, again, it's all about thinking about … what your property and methods are going to be used for … and what you want to limit access to. … That's really the whole idea here. … And when you're explicit like this, … it makes you at least think about the access modifiers. … I can understand not wanting to have additional code … on there that you think is repetitive, … but my personal preference is to get you to think about it. … And when I work in TypeScript, … I always have this setting turned on in my TS line … to make sure that people go when they do write this. … Especially if you're working with … maybe developers who aren't as experienced. … Now, a protected property, … let's just say we had a date of birth … and I'll abbreviate that for DOB, … this is one that perhaps …
Skill Level Intermediate
TypeScript: Upgrades and Featureswith Emmanuel Henri1h 15m Advanced
TypeScript for Node.js Developerswith Emmanuel Henri1h 2m Intermediate
1. Classes in TypeScript
2. Inheritance in TypeScript
3. Access Modifiers in TypeScript
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.