Architectural question

Topics: General Discussion Forum, Service Factory Modeling Edition Forum
Feb 20, 2009 at 2:11 PM
Hi,

most of the architectural guidance of the web service software factory is very logical to me: a message comes in, the data contract is mapped a business entity which is passed to a repository. However, I find two aspects a little strange about how the solution is structured in projects. Let me explain.

If I take the BlueYonderAirlines example, the structure is:

BYA.Mfg.SCM.Svc.WCF
  Source
    Business Logic
      BYA.Mfg.SCM.Svc.WCF.BusinessEntities
      BYA.Mfg.SCM.Svc.WCF.BusinessLogic
    Resource Access
      BYA.Mfg.SCM.Svc.WCF.DataAccess
    Service Interface
      BYA.Mfg.SCM.Svc.WCF.DataContracts
      BYA.Mfg.SCM.Svc.WCF.FaultContracts
      BYA.Mfg.SCM.Svc.WCF.MessageContracts
      BYA.Mfg.SCM.Svc.WCF.ServiceContracts
      BYA.Mfg.SCM.Svc.WCF.ServiceImplementation
  Tests

I don't understand why BusinessEntities and DataAccess are part of the BYA.Mfg.SCM.Svc.WCF project. What I have done in my design, is define these outside any business project so that they can be reused by every business project. Because where would you define a business entity that is used by a number of business projects? Where would you define data access routines that are used by multiple business projects? Also, woon't you have a risk of ending up with circular references in more complex projects? So it seems more logical to define one single project that contains the enterprise wide business entities, that are the same to all business projects; and one project with all repositories, used by every business logic project.

So why would you not do something like this:

BYA.Mfg.SCM.Svc.WCF
  Source
    Business Logic
      BYA.Mfg.SCM.Svc.WCF.BusinessLogic
    Service Interface
      BYA.Mfg.SCM.Svc.WCF.DataContracts
      BYA.Mfg.SCM.Svc.WCF.FaultContracts
      BYA.Mfg.SCM.Svc.WCF.MessageContracts
      BYA.Mfg.SCM.Svc.WCF.ServiceContracts
      BYA.Mfg.SCM.Svc.WCF.ServiceImplementation
  Tests
BYA.Mfg.ResourceAccess.DataAccess
BYA.Mfg.Business.BusinessEntities

If someone can give me some insight about this, that would be great! I was also wondering whether a complete example that uses all layers can be downloaded somewhere?

Thanks for the feedback!
Developer
Feb 21, 2009 at 1:36 PM
It's perfectly fine to reuse the business logic and data access across your enterprise solutions. The BlueYonder sample is basically a very brief overview of hoe to use the factory and basically show an implementation for a  small business which does not need to reuse any other asset. In your scenario, is perfectly fine to separate those projects into separate solutions and use only references to these libraries or put them in a separate solution folder. The WSSF is showing the general pattern in one solution template where you can freely adapt to your company needs.