---
title: "Discussion on \"Enhancing Code Reusability with NestJS Abstract Repository Pattern Best Practices and Examples\" | Hashnode"
description: "Discussion on \"Enhancing Code Reusability with NestJS Abstract Repository Pattern Best Practices and Examples\". The abstract repository pattern is a design approach commonly used in software development to separate the data access logic from the rest of the applicatio"
url: "https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Enhancing Code Reusability with NestJS Abstract Repository Pattern Best Practices and Examples](https://chukwuemekeclinton.hashnode.dev/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples?utm_source=hashnode&utm_medium=feed)

The abstract repository pattern is a design approach commonly used in software development to separate the data access logic from the rest of the applicatio

Sep 1, 2023 · 5 min read · chukwuemekeclinton.hashnode.dev  
Read the article

-   [#nestjs](https://hashnode.com/tag/nestjs)
-   [#typeorm](https://hashnode.com/tag/typeorm)
-   [#docker](https://hashnode.com/tag/docker)
-   [#repository](https://hashnode.com/tag/repository)

## Written by

[Ofuzor Chukwuemeke](https://hashnode.com/@chukwuemeke)

@chukwuemeke · Lagos. Nigeria

  
[View profile](https://hashnode.com/@chukwuemeke)

SOFTWARE DEVELOPER

I'm a full-stack Blockchain engineer

## Responses 2

Markdown supported · ⌘↵ to post

[Ivan Ivan](https://hashnode.com/@retouch)

[Jan 15, 2025](https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f/comment/678770f92f84406d23f4784a)

Hello, how about dto? what if we want some properties to be required and others to be optional, how do we validate them with class-validator etc?

[Ivan Ivan](https://hashnode.com/@retouch)

[Jan 14, 2025](https://hashnode.com/posts/enhancing-code-reusability-with-nestjs-abstract-repository-pattern-best-practices-and-examples/64f12b5d8e6a4ae79ac5511f/comment/6786c2273e522f3ace453b6a)

Can't understand how it should work with create method, if in different entities we have different implementation, different calculations, somewhere need to use transactions etc...
