Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class vs Namespace #65

Open
ryanjerskine opened this issue Jan 24, 2019 · 4 comments
Open

Class vs Namespace #65

ryanjerskine opened this issue Jan 24, 2019 · 4 comments

Comments

@ryanjerskine
Copy link

Is there a reason that something like Create.cs has Create as a class instead of a namespace? I have also been frequently told that I should follow one class per file. Would it be better to have create be a folder with The command/validator/handler as classes inside of that folder?

@adamhathcock
Copy link
Collaborator

I put tiny classes into one file because it's easier to see them. They're related commands and often dev with them together.

Usually, I do put classes in their own file but trying out something new.

@ryanjerskine
Copy link
Author

I totally get why they are in one file. I was more wondering why you had Create as a class instead of a namespace in that file.

@antonioortizpola
Copy link

I guess you refer to this part:

namespace Conduit.Features.Articles
{
    public class Create // Class
    {
        public class ArticleData // Inner class

Why internal classes?

@adamhathcock
Copy link
Collaborator

See my previous answer. I was following a pattern for grouping small classes. May not be always the best decision.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants