Join Reynald Adolphe for an in-depth discussion in this video Related objects needed once, part of C# Best Practices for Developers.
- [Instructor] Often times an object might depend…on another object.…For example, we've been working with the actor class…and since actors are usually associated with talent agencies…we can possibly have an actor class that has an agency…as one of its properties and the way that agency object…is instantiated depends on how its used.…There's three common scenarios.…The object might be needed once, for example, the actor…might only need to access the agency name one time,…or the object might be needed all the time.…
Let's say the actor always includes…the agency object information.…And then there's sometimes.…Maybe the agency information associated with the actor…is only needed if the actor's employed.…Let's go ahead starting off with scenario one…to see an example.…To get started let's go ahead and create an agency class…within the project prestige.bis so I'll go ahead and select…Add, Class, Agency.…
We'll make this public…and create a property called name,…that is of a type string and we'll assign it…a default value of Prestige Talent,…
- Naming and handling classes
- Running a unit test
- Using constructors
- Naming and handling methods, fields, and properties
- Using properties correctly
- Managing objects efficiently
- Common design patterns as best practices
Skill Level Intermediate
1. Best Practices: An Overview
2. Naming and Handling Classes
3. Naming and Handling Methods, Fields, and Properties
4. Managing Objects Efficiently
5. More Best Practices Resources
- 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.