Sample development and system services

SOA Services library is the fundamental component of each SOA service in the platform. Services offered by this library can be regarded as System services or Development services.

We have created a dummy template of the SOA services library, and it is enough to give you a good start. The primary interfacing part of this library starts with the SOA context. As the name suggests, it provides the context to an implementing service in the given SOA platform. The context enables tracing and tracking for the SOA service as well as the standard logging provider.

The following are the minimum number of classes and services provided by the SOA services library:

Classes in SOA services library

The most important and the vital class, which is used by all SOA web services, is SOAContext. Also, it's the first class for which we view the code, so we will view it completely to have an idea of how we are going to structure the whole class, including the comments:

    // <copyright file="SOAContext.cs" company="HIJK"> 
// Copyright (c) HIJK Ltd. All rights reserved.
// </copyright>
// <summary>
// <project>HIJK SOA Services</project>
// <description>
// HIJK SOA wide basic services across the whole platform
// </description>
// </summary>

namespace HIJK.SOA.SOAServices
{
/// <summary>
/// This object provides the basic SOA context to
all the SOA services in the HIJK's SOA Platform
/// </summary>
public class SOAContext
{
public SOALogger soaLogger;
//SOATracker soaTracker;

private SOAServiceStructure soaServiceStructure;

public SOAContext()
{
//Basic SOA Services, libraries,
configuration initialization
soaLogger = new SOALogger();
}

/// <summary>
/// Initialize the SOA context
/// </summary>
public void Initialize()
{
//Initialize soaLogger & soaTracker
//Read configuration or other meta-information
mechanism to discover the SOA Service
(which is using it) under the context
//Create SOAServiceStructure: SOAMetaInfo & SOAPayload
//Debug, SOA, Verbose logs
}


/// <summary>
/// Close the SOA context successfully
/// </summary>
public void Close()
{
//Close the context
//SOALogger.Log
//SOATracker.Finish
}

/// <summary>
/// Close the SOA context with error
/// </summary>
/// <param name="soaError"></param>
public void Close(SOAError soaError)
{
//Close the context
//SOALogger.LogError
//SOATracker.Finish
}
}
}

The web services will always use SOAContext.Initialize() at the start of their web service method, and Close() before the end of the method to open and close the context, and being part of the services in the SOA platform.

SOA context can be initializing some configuration, keeping the payload types and meta-information regarding the service, setting the service bus channel so that all this information will be automatically used in case of tracking, logging, and error handling when required behind the scenes.

Note that the log levels can either be mentioned in the static or dynamic configuration as per the platform level configuration mechanism.

All services are implemented using ASP.NET Core REST Web API with MVC; therefore, all the services expose the functionality through Controllers. For example, the Employee service is EmployeeController.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.55.20