• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 832
  • Last Modified:

What is the best design strategy for exposing multiple DataObjects/Methods within the .Net WCF service framework?

Hi:

I'm relatively new the world of Microsoft WCF.
I have a few questions regarding the best design pattern/method to use to implement one or more services that will address my needs.

I have an existing DataLayer which I would like to push into 1 or more WCF services. The backend database is ORACLE (and I have an entire data access layer which communicates with the correct version of ODAC).

When I look at my existing datalayer, I (more or less) have support for the following data objects (classes).

User Info
=======
Data:
-------
  UserId
  First Name
  Last Name
  Firm
  PWD
  EmailAddress
   ...

Methods:
------------
 CreateUser
 DeleteUser
 ModifyUser
 AssignUserRole
 Logon (Validate User)


UserActivityHistoryAudit
====================
Data:
------
  UserId
  ActivityId
  ActivityTime
  Activity
  ActivitySource
  ActivityDetails

Methods:
------------
   InsertActivity
   UpdateActivity
   DeleteActivity
   GetActivity

Evaluations
=========
Data:
-------
  EntityType (EntityName, EntityID, ....)
  EntityFields (EntityTypeID, FieldID, FieldName, FieldType)
  EntityValue (EntityID)
  EntityFieldValues (EntityID, list of (EntityField, Value))
  QueryField (FieldName, Operator, Data)
 

Methods:
------------
GetEntity()
GetEntityFields()
QueryEntityValues()

EvaluationWorkFlowAndReview
==========================
Data:
-------
class EvaluationReview { ... }
class EvaluationReviewComment { ... }
class EvaluationReviewResearch { ... }
class EvaluationReviewStatus { ... }

Methods:
-------------
   interface EvaluationReview { insert, update, delete, get }
   interface EvaluationReviewComment { insert, update, delete, get }
   interface EvaluationReviewResearch { insert, update, delete, get }
   interface EvaluationReviewStatus { insert, update, delete, get }


EvaluationReports
===============
Data:  ....

Methods:
 Get, Update, Insert, Delete

I have several questions involving the best way to implement this in WCF.

1) Is it best to implement this as one service or several services (one which coincides with each data class/functionality)?

2) Ultimately, I would like to share the underlying Data Access layer which communicates with the ORACLE ODAC library.  Is it best to embed this in a shared library, assembly?

3) If I go with multiple services, is it cleaner to hang them all off of the same endpoint?

What is the best strategy to use when designing this?

Thanks,
JohnB
0
jxbma
Asked:
jxbma
2 Solutions
 
Vel EousResearch & Development ManagerCommented:
1) Is it best to implement this as one service or several services (one which coincides with each data class/functionality)?
Personally I would split this into several services (User, Activity, etc) which encapsulate any functionality pertinent to that service object.

2) Ultimately, I would like to share the underlying Data Access layer which communicates with the ORACLE ODAC library.  Is it best to embed this in a shared library, assembly?
I assume you mean you want share this DAL between your services. You could do as you have mentioned and include it as a library reference, or alternatively you could expose it as a service.

3) If I go with multiple services, is it cleaner to hang them all off of the same endpoint?
Each service should be exposed on a unique endpoint.
0
 
apeterCommented:
1) Is it best to implement this as one service or several services (one which coincides with each data class/functionality)?
             Try to group functionalities/methods together under one service. There is no gain in having many services.

2) Ultimately, I would like to share the underlying Data Access layer which communicates with the ORACLE ODAC library.  Is it best to embed this in a shared library, assembly?
             Have a service layer where you have all the services. You can other layers like, Business Logic,  DAC component, Libaray,  Model classes etc.

3) If I go with multiple services, is it cleaner to hang them all off of the same endpoint?
           If multiple services, you should have different endpoint but you reuse bindingconfiguration etc.
0
 
jxbmaSoftware ConsultantAuthor Commented:
Thanks for the useful feedback.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now