Join Reynald Adolphe for an in-depth discussion in this video Static classes, part of C# Best Practices for Developers.
- [Voiceover] I'd like to turn our attention now…to static classes.…And currently, the class that we're looking at…doesn't have any.…Now a static class is basically the same…as a non-static class, but there's one major difference.…A static class can not be instantiated.…They're good for services like a logging system,…or a notification system.…And I'd like to talk now about some best practices…in respect to them.…So let's get started…by creating a small notification system.…
I'll go to our solution and select add, new project.…And we're going to want to select a class library.…So I'll choose visual C sharp and select class library,…specifically the dot net framework,…and we'll call this prestige dot common.…'Cause we can consider it a common utility.…Now let's go ahead and rename our class…to notification service.…
Do I want to rename my class?…Yes I do.…So it renamed it from class one to notification service.…So in this class, we'll go ahead and create a method…called notify talent.…And it will accept a perimeter of talent name.…
- 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.