Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I always like to learn from other developer's code; in looking through the Dialogue source, I see there are several "service" classes like Memberservice, TopicService, etc. I am curious what the benefit is for not having them as static classes? They all appear to be stateless, and their methods also appear to be pretty threadsafe.
I'm answering this as not something specific to Dialogue, but a general question of why use a service instead of static classes; Which is a fair question, but not something specific to Umbraco, ASP.NET or for that matter C#.
I thought best to give you a few links to look at:-
My general rule for static classes is only use them when you have to, not because you can. If you were to chart the progression of computer programming over the last 30 years, the aim to reduce global and static content has been never ending and more inventive approaches have been deployed to achieve this. Singletons for example.
On a practical note, many/most/99% use static classes on helper classes, feel free to debate freely on the pros and cons of such behaviour - great, a necessary evil or pedantic mussing.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted