Hello,
I am working on a project that will migrate and update an existing EF database application to a service application using WCF. This new application will be
using Telerik Open Access instead of Entity Framework.
The last few weeks I am doing some research on service application using WCF, because I have not much experience with it. At this moment I am getting some understanding how I should build this.
I started a test project to build a demo application, in which I will test different solutions of problems I will face. I have created a new rlinq model which holds
all the tables of the database. I am now at the stage of generating the server side code for this model.
My main concern now is if I will use the Telerik WCF Plain Services wizard to generate my repositories, services and DTO’s or will I code them by hand.
Pros of the wizard (for me):
- The database will be updated a lot in the feature, because we are still adding new tables to the database in the end it will contain 200-300 tables. Using the
wizard I can easily update the generated code.
- It will save me a lot of time compared to code everything by hand.
The main disadvantage for me is that the wizard is creating all types inside one file (all services are in one file, all repositories in one etc.). I don’t feel very comfortable
with this and of the fact that I don’t have any control of how and what is generated.
My plan was to create separate libraries for the services, dto and repositories, this will give me a clear separation of the different layers of the server-side. I am considering changing the code-generation templates but I am not very familiar with this. I also don’t know if this is possible to achieve.
Also I don’t know if I want to have a service/datacontract per table, maybe it will be more convenient to combine them by screen, or something else. This will not be
possible to achieve using the templates, then I will still be creating some of the code.
So I am a little stuck now, I followed a number of tutorials and read many blogs/forums on the internet, some people advise to code by hand and others advice to use
the code-generation.
This adds even more doubts, so should I go for the simple way and generate the code, in the future it will be very easy to update everything (in my understanding) if
the database will change.
Or should I go for the more complex way, this will give me more control of what and how everything is coded, but it comes at the cost of coding everything and more
work every time I update the database.
At this moment I am more convenient with the second option, because this will give me a good understanding of WCF and how it works in the end. My biggest fear is that this will bite me in the end, because I am making it more complex then it needs to be.
Any advice would be greatly appreciated.
Marcel