The code which was modified to apply the Repository Strategy Pattern will be reviewed in this video. Reynald will explain what code was there before the modifications and the new changes that were made. Specifically, he will cover those related to CRUD (Create, read, update, delete) operations and the disposing of objects.
- [Voiceover] I have here an MVC application…that maintains a database of students…and faculty members.…What I'm going to do is step through…the relevant parts I added and changed…to convert the architecture…to conform to the repository pattern.…So the first thing I did is created…an interface called IStudentRepository.…And that's in the DAL folder.…So let's navigate to the DAL folder…and open up IStudentRepository.…Now the code here is fairly straightforward.…
It declares a typical set of CRUD method signatures,…CRUD standing for Create Read Update Delete.…And it includes two read methods:…one that returns all student entities…and one that finds a single student entity by ID.…The next thing I did is created a StudentRepository class…which is the concrete implementation of this interface.…That's also in the DAL folder.…So let's open that up.…So there's quite a bit in this file here…so I separated the code into parts.…
In part one, I have the repository database context…defined as a class variable…and the constructor expects the calling object…
In this course, developer and technologist Reynald Adolphe explains the purpose and effective use of eight design patterns, including six Gang of Four design patterns and two .NET patterns. Gang of Four patterns fall under three categories: structural, creational, and behavioral. Reynald helps you learn about select patterns from each category. He describes each pattern and demonstrates how programmers can leverage them in real-world applications.
- Factory Method
- Abstract Factory
- Singleton pattern
- Decorator pattern
- Iterator pattern
- Observer pattern
- Repository pattern
- Unit of Work pattern
Skill Level Intermediate
2. Factory Method
3. Abstract Factory
4. Singleton Pattern
5. Decorator Pattern
6. Iterator Pattern
7. Observer Pattern
8. Repository Pattern
9. Unit of Work Pattern
Convert to Unit of Work3m 53s
- 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.