Home > Articles > Programming > C/C++

Generic C++ for Networks

  • Print
  • + Share This
Service oriented architectures sound complicated and daunting, but they're not so hard to implement. The concepts involved are actually fairly simple, and this article describes them by using examples drawn from the networking domain. Software consultant Stephen B. Morris describes some of the principles of service orientation in the down-to-earth contexts of C++ and networking.
Like this article? We recommend

Like this article? We recommend

Client-server software has come a long way since the mid-90s. Service is now the industry buzzword and IT facilities all over the world are being upgraded to deliver on the promise of this new approach. The major driver for this is that IT infrastructure must now deliver services that facilitate business needs. This sounds daunting, but the concepts are fairly simple, and this article describes them by using examples drawn from the networking domain. It considers service requests, queues, executing service requests, and a short description of workflows. Finally, the queue structure and performance is briefly analyzed.

The Takeaway

Service orientation is becoming the norm in IT as many organizations face into massive migration efforts. The concepts underlying much of this work are well established—only the terminology and some of the technology are different! I hope you’ll take away from this article a good base from which to look further at service-oriented software. These ideas are illustrated with respect to networking, but are also relevant to other domains. Along the way, I’ll describe my reasons for choosing a queue data structure for handling service requests.

Listing 1 shows a sneak preview of the type of code we’ll be looking at where a service request is

  1. Created
  2. Queued
  3. Removed from the queue
  4. Executed
  5. Deleted

Between steps 2 and 3, we could typically expect many other actions but I keep it simple in Listing 1 to illustrate the overall flow.

Listing 1 Implementation of a Service-Oriented Program

  char serviceRequest1[] = "Enable Link 1";
  NMSServiceQueue* aServiceQueue = new NMSServiceQueue();
  // Many more steps here
  QueueElementPtr anOperation = aServiceQueue->remove();
  if (anOperation)
   printf("Removed a queue element: %s\n", anOperation->requiredOperation);
  delete anOperation->requiredOperation;
  delete anOperation;

First, let’s look a little at the background.

  • + Share This
  • 🔖 Save To Your Account