S
shapper
Hello,
In many C# code examples I see classes that are named Factory or
Service.
For example: ValidationFactory, MailService, etc.
What is the difference?
I usually name Repository to all classes that interact with a
database. For example:
ProductRepository, UsersRepository, etc ...
And then I use Service for other classes that perform some kind of
action like:
MailService > Sends emails, newsletters, etc
FileService > Saves files, for example, after being submitted by
forms, etc
But the Factory is puzzling me ... maybe Factory and Services are the
same thing?
I am just trying to be consistent when creating my C# code.
Thank You,
Miguel
In many C# code examples I see classes that are named Factory or
Service.
For example: ValidationFactory, MailService, etc.
What is the difference?
I usually name Repository to all classes that interact with a
database. For example:
ProductRepository, UsersRepository, etc ...
And then I use Service for other classes that perform some kind of
action like:
MailService > Sends emails, newsletters, etc
FileService > Saves files, for example, after being submitted by
forms, etc
But the Factory is puzzling me ... maybe Factory and Services are the
same thing?
I am just trying to be consistent when creating my C# code.
Thank You,
Miguel