2

I currently reading a lot about Design Patterns and I have been watching various Pluralsight videos from their library. Now so far I have learnt the following:

  1. Repository Pattern
  2. Unit of Work Pattern
  3. Abstract Factory Pattern
  4. Reading the awesome "DI in .NET" book

Now I read lot about Services and Service Layers and wanted some advice about the best place to read up and learn about these. I presume this fits into Domain Driven Design and I should start there? The term "Service" just seem to be used widely within IT and it can be confusing the exact meaning.

So my questions is:

  1. What is the Service Layer
  2. Where is the best place to learn about them. I know there are probably tonnes of interweb/books/blogs on the subject, but some good areas to start from would be nice.

If I'm being too vague, let me know.

4
  • Reason for the markdown, then I can improve the Question? :)
    – garfbradaz
    Dec 7, 2012 at 20:00
  • 1
  • 3
    A "Service Layer" is not a design pattern per se, its more of an architectural pattern. There are lots of resources you can turn up w/ a search, but specifically you may want to check out Martin Fowler's Patterns of Enterprise Application Architecture; in addition to a number of other useful patterns it has a section on Service Layers. There's also another book in Fowler's signature series (by another author) called Service Design Patterns which is pretty decent. In the meantime, to put it into design pattern speak, many service layers take the form of a "remote facade". Dec 7, 2012 at 20:15
  • @EdHastings Beautiful thank you! I have a splint on at the moment and cannot code. So the more reading the better! So apologies for the delay in replying as im typing one hand!
    – garfbradaz
    Dec 7, 2012 at 20:27

2 Answers 2

3

How accurate this advice is may vary, over on StackOverflow someone stated: "Be wary of Design Patterns; learning a Pattern may inhibit your ability to correctly implement the proper design. This can cause bad developer habits and practices."

Which does make sense; as your bending your application to a pattern rather the pattern to your application. Which is essentially like a cookie-cutter approach.

However...

Codeplex has some great tutorials on Dependency Injection, Repository, Unit Of Work. Plus Amazon has some great books out there as well. Microsoft has a free architecture handbook which is very solid also. The Stack Overflow post has a link to that manual, but here is a direct link.

A pattern you may want to look into is SOA(Service Oriented Architecture). It is looked at as an Anti-Pattern, but with the culmination of Windows Communication Service and abstraction. It can provide a very agile lightweight flexible solution. Assuming your application benefits from this approach.

  • Service Oriented Architecture
  • ORM
  • Dependency Injection
  • Repository Pattern
  • N-Tier Applications

Those are few sites with good details; hopefully that is helpful. There is a lot to learn; but the simplest solution is usually the right solution.

I had a bunch of links; but my rep is too low on this site to post em. Just Google those terms and you should get some nice articles.

3
  • 1
    I think Design Patterns are more about a common language: "This is kind of like Pattern X, but instead of doing it the way the books all say, I tweaked it like this." Also, knowing patterns helps with naming your Classes. It kind of sucks to find out a couple of months after you called your Class ThingieFactoryManager that you could have called it ThingieBuilder and have the purpose be much more clear. Apr 3, 2013 at 1:05
  • 2
    I'm interested in the free architecture handbook by Microsoft, but the link redirects to Stack Overflow...
    – Aschratt
    Apr 3, 2013 at 8:03
  • @Aschratt msdn.microsoft.com/en-us/library/ff650706.aspx
    – Greg
    Apr 3, 2013 at 15:09
0

Aside from pluralsight, I found that dofactory was a great place to learn about patterns. Their Patterns in Action project provides a reference Visual Studio solution depicting many of the architectural patterns you'll want to learn about, including the hosting and service layers.

In dofactory's reference solution, the service layer is depicted as the abstraction of the core functionality of the application. It is the interface through which the higher layers do work. Notice the break-out of the hosting and service layer allowing the services to be made available and reused in different scenarios.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.