views:

38

answers:

2

I learn that Service Layer is above Business Logic Layer and we call Service Layer from Presentation Layer. But in project do we call Web or WCF service defined in same application? If we exposed all our logic in service layer and call the services rather than methods in business logic layer, it should has a sacrifice in performance. I doubt whether we do this in project. But if we call Web or WCF service defined in other application, I think we can also call them from our Data Access Layer or Business Logic Layer. I am very confused about this, can someone give me a clue?

I am looking forward to your reply. Thanks very much!

+2  A: 

I would answer yes to many of questions and warn you about the paths. You miss the very fundamental thing about SOA. First, you need to understand what Service Inventory means before you do any web services development.

Service inventory can comprises three basic service type:

  1. Entity Services - this kind of service works with data-related issues - CRUD. Yes, querying databases.

  2. Utility Services - this kind perform infrastructure works like send e-mail, "logging", etc.

  3. Task Services - this orchestrates other services (entity, task and utilities) and actually perform the business rules.

For example, an UI application may call a Task Service, which in turn call other two Entity Services, perform the business logic, notifies users by mailing them, call another task service which also may call other services type.

But you need to take care about this. Coupling services would mean coupling infrastructure. Have a look at SoaPrinciples.com, by the book and go to SoaSchool.com. there's a lot to understand before write services with quality.

I'm implementing a ecosystem totally based on this concepts using WCF. Part of it is already on production and I have no problem about performance at all. Instead, users are really happy. But it is not so easy, I wouldn't relay on standard programming style. There was a mind-shift on programming style and I had to master concurrency issues and parallel programming. Best thing I ever did! I still can't use the true potential of my multi-core server.

good luck!

Eduardo Xavier
A: 

Here are some practical examples of how to build a SOA using WCF.

I would suggest you read articles by Thomas Erl and Roger Sessions, this will give you a firm handle on what SOA is all about.

SOA Design Pattern

Achieving integrity in a SOA

Why your SOA should be like a VW Beetle

SOA explained for your boss

MetalLemon