Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to create service implementations
xomega
#1 Posted : Tuesday, August 28, 2012 6:54:41 PM(UTC)
xomega



After you define the service operations in Xomega, you can quickly and easily create implementation classes for such services by first using a generator to create an initial implementation of the service class and then leveraging the power of Xomega Framework, Entity Framework and the LINQ technology to implement the business logic of your service. This helps you to stay focused on the functionality of your system rather than on the plumbing code that is necessary to make it all work.

Here's a sequence of steps you can take to create the implementation classes for your services.
  1. Define your operations including the input and output structures in your model. You can also leverage the generator of the standard CRUD operations and then update them for your specific needs, or you can define the operations from scratch.
  2. Configure the namespaces for the generated service classes.
  3. Generate the WCF Service Contracts from the operations.
  4. Open the properties tab of the Service Implementation generator in the Business Layer generator group.
  5. Set the Output Path parameter to where you want the generated classes to go. Use the {File} placeholder to indicate the location of individual services. You can also use the {Module/} placeholder to place services in different folders based on the modules of the corresponding objects, for example ../MyProject.Entities/{Module/}_{File}.cs. We recommend outputting the generated files into a dedicated directory or using a certain naming convention, so that it won't overwrite the manually update files.
  6. If you want the generator to automatically add the generated files to one of your projects, then you need to specify the path to the project file in the Add To Project parameter.
  7. Run the generator and add the generated files to your project as necessary.
  8. Review the generated classes. If the model needs to be updated, then make the necessary changes and regenerate using the steps above. Otherwise rename/move the generated file, so that it doesn't get accidentally overwritten by a subsequent rerun of the generator.
  9. Update the generated implementation to use/populate all the input/output parameters that were not properly handled by the generated code. Generally, the generator will create TODO comments for each such parameter for you to implement.
  10. Implement the business logic of the service operations using the Xomega Framework, Entity Framework and LINQ. You can read this article on how to build WCF services with Xomega Framework.

If you already have a manually coded service implementation class and need to update an existing operation or define a new operation in the model, then you can still use the generator to create a service implementation class using the steps above, but instead of copying and/or renaming the generated file you can copy just the part of the generated code that is related to your update and paste it into your existing implementation class as appropriate.
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Copyright © 2009-2022 Xomega.Net. All rights reserved.