I wanted to create a multitier test project using Telerik OpenAccess ORM Free Edition and WCF Plain Service.
I created a test solution with the following projects:
OrmMutlitierTestWF Windows Form
OrmMultitierTestBF WCF Plain Service
OrmMultitierTestSF Class library (dto classes)
OrmMultitierTestBR Class library (Business Rules/Business logic)
OrmMultitierTestDA Class library (Data Access)
I also have a SQL Server Database with a number of table.
I have added the following references
WF has a service reference to BF
WF has a reference to SF
BF has a reference to SF
BF has a rererence to BR
BR has a reference to DA
In the DA Class library I did an Add Domain model and created an EntetiesModel without problem.
Then I created OpenAccess Service and here I ran into some problems and have some questions/suggesions
regarding OpenAccess ORM:
I want the Service code base to be created in the BF project and the DTO classes to be created in the SF project.
It seems that in the output settings the service can only be placed in a WCF Service project but the Service code base
to be placed in any type project.
Due to these constraints I had to place everything in the BF project.
When I created the service reference in WF i also got a plain reference to the BF project (because it needs access to the dto classes)
When I build the solution and look in the WF\bin\debug folder I see that all DLLs have been copied here.
In a multitier application the presentation layer (Windows Forms) should have no knowledege of BR and DA classes.
I moved the transport.vb file from the BF project to the SF Project and changed the BF.dto imports to SF.dto in all
.vb files in the WCF Plain Service project. and fixed all errors that appeared in the error list.
In the WF project i removed the rerence to the BF project. I kept the Service Reference to BF and the reference to SF.
Now my testproject is set up the way I like it. If there should be any changes and I recreate the service via the
OpenAccess Service Wizard it will be messed up again.
Hence I would like to propose the following changes in the OpenAccess Service Wizard:
On the first page under Output Settings it should look like this:
a Combobox where you select the project where the Service Code base (CRUD methods) should be created (Always a WCF Service Library?)
a Combobox where you select the project where the dto classes should be created (Always a Class Library)
a Checkbox Do you want to implement a Business Rules/Business Logic layer)
a Combobox where you select the project where the Business Rules/Logic classes should be created).
If you choose NOT to use a Business Logic layer the WCF Service should use the Data access layer directly as it does today.
If you choose to use a Business Logic layer the WCF Service should reference that layer and make all calls into it and the
Busines layer forwards the calls into the Data Access layer. I can then add any logic I desire into the business classes.
The Output Settings could do with some more explanation as to what will be created in each selected project.
The things I feel is wrong with the OpenAccess Service Wizard (2013.1) today:
Host in project: It must be a WCF Service Library and the dto classes will be created here. I believe that the dtos
should never be created in the WCF Service Library, they should be in a regular Class Library.
Serivce code base: it can be any type and the CRUD methods will be created here. The Crud Methods should always
be created in a WCF Service library.
Support for Business Rules/Business Logic layer should be added. If I have added my own logic here It must not be overwritten.
I hope others will agree with me that this is the desired behavior of the OpenAccess Service Wizard and that Telerik
will release a new version with this behavior ASAP.
I am now going to look at my WCF Service and see if I can change it so all calls are routed through the Business Logic Layer.