Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- The "Common" directory in a .NET project typically contains classes, utilities, and components that are shared across different parts of the application or even across different projects within the same solution.
- Generally, you might place the following types of classes in a "Common" folder:
- Utility or Helper Classes: These are classes that provide common functionality that's used in various places in the application, such as string manipulation, date/time format conversion, error logging, validation, etc.
- Constants: You might have a class that just contains constant values that are used throughout your application.
- Extensions: You may write extension methods for existing .NET classes or your own custom classes. These are typically placed in a common location as they are often used across the project.
- Shared Interfaces or Base Classes: If you have interfaces or base classes that multiple components depend upon, those could go in the common folder.
- Shared Model Classes: For example, DTOs (Data Transfer Objects) or entities that are used in multiple parts of the application.
- Cross-Cutting Concerns: Like logging, caching, configuration, and exception handling.
- Remember, organizing your code into appropriate folders is a matter of keeping your project structured, maintainable and ensuring that components can easily be found when needed. The "Common" directory approach is a popular one, but it's not strict, and depending on the project structure and team preferences, it might be called differently, like "Shared", "Utilities", etc.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement