Coupling and Cohesion: An SOA Challenge

Cohesion and coupling are two fundamental concepts in software development at least since Stevens, Myers and Constantine published their seminal article “Structured Design” in 1974.[1] Since then, however, there has been a great deal of metamorphosis, metastasis and other alterations to the basic definitions depending upon the context and the application.

Stevens, et al. defined coupling as “the measure of the strength of association established by connection of one module to another.” In the context of most current Service Oriented Architecture implementations, this is defined by the association between the services that make up the application itself. Since loose-coupling is often viewed as one of (if not the) fundamental values Service Oriented Architecture (SOA) brings to the enterprise, it is somewhat more well-defined in the SOA context than cohesion.

Applying the principles of high cohesion to SOA is not so readily apparent, but one way to understand it is through its relationship to coupling. Cohesion is usually described through variations of the list originally defined in “Structured Programming” [2] and consist of six or seven levels of increasing cohesion[3] from Coincidental (no significant or discernible relationship between elements in a module) to Functional (elements of a module are grouped together because they all contribute to a single well-defined [and described] task).

In the realm of SOA the same cohesion principles still pertain, but they need to be applied in new ways. There are three different aspects to achieving functional cohesion in an SOA which we suggest should be divided into two categories—“particular” cohesion on the one hand and a “holistic” cohesion on the other. Particular cohesion mirrors the way architects have thought about cohesion for years, while holistic cohesion is more of a reflection of the unique nature of SOAs.

Particular cohesion is an application of the principle of cohesion to services themselves in a manner typical to how it is applied to objects. There are two types of services to which this form of cohesion applies:

  • Atomic services
    • Atomic services are the single grains in overall granularity of services. They are the smallest, business-oriented service that is required. Such a service might be a GetProductName or GetInventory service.
    • This is roughly equivalent to the OO Single Responsibility Principle.
    • It also supports the principle of service autonomy.[4]
  • Composite services
    • A composite service should also do “one thing” even though it may access many other services
    • This technically violates the principle of autonomy, but per the definition of functional cohesion in which “occurs when a routine [service] performs one and only one operation,”[5] from a business perspective and SOA perspective a CheckOrder service that utilizes a ProductCatalog service, a Customer service and an OrderRetrieve service is serving a functionally cohesive role.

Holistic cohesion is an animal of different species within the same genus of cohesion. It is an effort to ensure that consumers (applications, other services, etc.) that are communicating with a service maintain cohesion through the vehicle of the message, even though the services themselves are loosely coupled. In order to achieve the goals of reliability, re-usability and understandability, services need to be able to communicate efficiently; improving that efficiency is the purpose of holistic cohesion.

In order to achieve this, the messages themselves must provide the “glue” that makes such cohesion possible. The list below provides examples of how holistic cohesion could be achieved in the context of web services from the least cohesive (1) to the most (3).

  1. Sending un-typed or generic messages impedes that efficiency and limits cohesion.
  2. Utilizing messages with explicit internal relationships (i.e. .xml files with internal relationships between data elements defined by an .xsd) improves the cohesion between services without adding additional coupling.
  3. One of the highest forms of inter-service cohesion is to utilize known business entities described by .wsdl and .xsd with internal relationships between data elements fully described. These entities themselves should be “functionally” cohesive.

The use of business entities ensures that composite services, such as those in the CheckOrder example above, maintain their semantic “sameness,” despite loose-coupling.


[1] W.P Stevens, G.J. Myers, and L. L. Constantine, IBM Systems Journal 13(2): 115-139, 1974.

[2] Along with later works such as Steve McConnell, Code Complete, 2nd Ed. (Redmond: Microsoft Press, 2004), 168-171.

[3] In this context “module” refers to a defined entity such as a class, routine, etc. while “elements” refers to methods, subroutines, etc.

[4] John Evdemon, Principles of Service Design: Service Patterns and Anti-Patterns, (MSDN Solution Architecture Center, 2005) http://msdn.microsoft.com/en-us/library/ms954638.aspx .

[5] McConnell, 168.

Integrating Your Website with the Rest of Your Business

You’ve spent time and resources building a solid presence on the web. It’s attracting visitors and potential customers, but then what?  How does the information and opportunities it creates flow into the other parts of your business processes?

This is often the point at which web sites stall in their development. You know it’s important to get your information out there in order to get leads or even sales online, but, without clear direction, it typically goes no further.  At this point, your web site plays just one role in your business.

By taking the next step, and tying your website into other business processes, you can improve efficiencies and customer experience.

Leads

Contact forms are a commonplace feature on sites today. You want to make sure it’s a simple process for those interested in learning more about your products or services to get in touch with you. Usually this information is sent to someone internally via email. Sometimes that’s sufficient, but what if that person is busy or on vacation? The lead sits in there inbox, hidden until they can get back to it.

A better way to handle this is:

  • Have the lead feed directly into a CRM system.
  • The lead can go directly into a workflow, sending out notifications to both internal staff and the customer.
  • When the main contact is out of the office, the workflow would trigger an email to other staff that a lead has not been responded to and needs follow-up.
  • When that response does occur, it is recorded in the CRM system and available for others on staff to see.

In this case, the integration of the web site and the CRM system helps sales stay on top of new business opportunities regardless of staff availability.  One person being out does not hold up everything.  Furthermore, that lead can be tracked and followed from the time it’s entered until it’s closed without any need to manually reenter it into another system.

Support

Just as important as leads coming into sales, are questions and issues coming in from current customers.  Again, integration into CRM or a help desk makes your company more timely and efficient when handling requests.

The efficiencies in how customers are helped can be taken a step further.

  • As questions come in, staff can categorize these requests which can then be reported on.
  • As you see trends in what topics are popular, you can proactively address these by creating a knowledge base.  This is a set of reference articles can help both internal support staff and external customers.
  • Your staff can respond quickly with proven answers by directing customers to the knowledge base articles.
  • In the future, customers can search these articles and find the answers themselves, eliminating the need for support to get involved in these cases.

Sales

When a company selling products moves to the web, they usually have systems already in place for accounting, inventory tracking, and similar functions.  Once their web site starts bringing in orders, they may need to take the order information gathered from the web and then manually enter it into their internal systems.

The great thing about modern software systems is that data is stored in similar ways. This makes it possible to set up processes that synchronize this data.

For example, Pinnacle has built a solution called the Connector which allows businesses to set up maps between different databases and specifyhow the information flows between them.  Even if your systems store data in different ways (one stores quantity and unit price while the other just has a total), the integration can still be automated.

With a solution such as the Pinnacle Connector, or direct integration of the website with CRM, a company’s ecommerce store would be able to send the order processing information directly to their other systems, eliminating the possibility of human error, and ensuring that all necessary information has been entered into the correct systems.

Business Intelligence – “Cool as crap!”

As executives running business, we can spend hours (or have our employees spend hours) chasing information to create the reports that we need to make the informed decisions that keep our businesses running and successful.  One of the cool things about technology today, is that we have produced ways to streamline these reports to almost eradicate that daily labor and have the reports (and information tied to them) constantly at our fingertips.  Simply put, this is called Business Intelligence. And I call it… Cool as crap!

So, what is Business Intelligence (or BI)?  BI is gathering technological information and presenting it in a way that’s useful and dynamic.

BI is not new, and companies have used it for years to create charts and graphs to keep an eye on limited information.  What’s different now is that we can actually mine the data from your company software, put it in a centralized location and create both drillable and actionable up-to-the-minute reports on the information that is most important to you.

 

Example:

We worked with a client recently who had an employee that spent 2 ½ hours a day putting together a daily sales report.  By using Business Intelligence, we were able to create a live report to have the same information always immediately available to our client.  Thanks to BI, our client is able to save 600 labor hours a year, and at $10/hr (conservatively speaking), that’s $6,000 in a year.

Business Intelligence can centralize information from all types of systems including:

  • Accounting software (Like Microsoft Dynamics GP, Peachtree, QuickBooks, JD Edwards, etc)
  • Customer Relationship software (Like Microsoft Dynamics CRM or Salesforce)
  • Line of Business Application (Manufacturing software or whatever proprietary software you use to run your daily operations)

What makes this exciting is that before, you had to purchase special software to display the information in a particular dashboard or system.  Now, we are able to centralize these reports in the place that helps you the most.

Here are some of the ways we can centralize data:

  • Websites (including internal websites like SharePoint)
  • Business Dashboards (such as in GP 2010)
  • Excel files using PowerPivot (Yes… we can have up-to-date live information available in an Excel format with charts and graphics.)
  • SQL Reporting Services

Ask yourself.  How much time is being wasted by your top managers chasing, crunching, or sharing information?  What if you could free an additional 4-6 weeks a year for these key people to focus on new initiatives?  Business Intelligence can help take your organization to the next level by having critical, just-in-time information at teams’ fingertips.”  Or, in my own words, you could simply say it’s “cool as crap!”

Why Microsoft Dynamics GP 2010? Save Time and Money Like Never Before

I’m an accountant.  I’ve been an accountant for years, and I don’t like change.  So when I attended the Microsoft Convergence conference a few weeks ago, I expected to see some cool things, but what I didn’t expect was the excitement that I would have after receiving a taste of GP 2010’s new features.

 

Why is Microsoft Dynamics GP 2010 so dynamically better than before?  GP 2010 has created a bridge that eradicates numerous processes in order to go from point A to point B, making the accounting process easier, more efficient, and cost effective.

What are some of my favorite new features?

  • Emailing invoices is quick and easy.
  • Quickly and easily create different styles of invoices.
  • Quickly and easily pay vendors.

Noticing a theme here?  Quick and easy.   By bridging the gap between processes, GP 2010 takes you from having to do several things to reach your goal, to – in many cases – a simple and painless click of a button.

Let me go into some detail on why I find these new features exciting, and why I am implementing them in my own accounting practices.

Emailing Invoices

Process before GP 2010:

  • By Hand:  Print the invoice.  Fold and stuff the invoice into envelope.  Put a label on the envelope.  Place a stamp on the envelope.  Mail the envelope. 
  • Electronic:  Open the file.  Print and save to PDF.  Find the correct client email address.  Email the invoice.

Bridging the gap with GP 2010:  Click the “Email” button.

Yes.  That’s it.  One quick and easy step.  Consider the time, stamps, and materials that it takes yearly to send paper invoices.  For example purposes, let’s say that your Company mails out 1000 invoices a month.  Conservatively, your cost structure looks like this:

Time:

  • Print the invoice – 30 seconds
  • Fold and stuff the invoice into the envelope – 1 minute
  • Put a label and postage on the envelope – 30 seconds
  • Mail the envelope – 1 minute

Materials:

  • Paper – .02 cents per page 
  • Toner and other printer costs – .005 cents per page 
  • Envelope – .03 cents per page
  • Stamp – .44 cents per invoice

Therefore the total labor is 3 minutes per invoice times 1000 invoices equals 3000 minutes or 50 hours per month.  At a total compensation with benefits structure of $15 per hour, that equates to $750 per month.  For materials, you are at .50 cents per invoice – times 1000 invoices equals $500 per month.  Total monthly costs are $1250 per month.  Times that by twelve, and the organization has spent $15,000 in one year on a process that could take a few seconds and no material with the use of GP 2010.

In order to figure out how much money your organization is spending every year on this one process, follow this simple calculation:

(# of Invoices) times ($1.25) = Cost

Create Different Styles of Invoices

We’ve worked with many organizations that run multiple companies under one umbrella.  When it’s time to send invoices, the process is a lot more complicated than it would be for an organization that does not need more than one company invoice.

Process before GP 2010:

  • Log into first company account.  Process the invoices.  Log out.
  • Log into second company account.  Process the invoices….

Although doable, it is tedious to have to log in and out every time you need to access different profiles for each company.

Bridging the gap with GP 2010:  Easily create and manage different styles of invoices from one account.

Again, back to our theme… quick and easy.  Save time (and therefore money) by managing this complexity utilizing the out of the box functionality of GP2010 – creating multiple styles of invoices – using a Tool that you love – Microsoft Word!

Paying Vendors

We all have our own horror stories when it comes to checks being lost or stolen.  In order for you to understand why I love this new feature, I’m going to share one from a client of mine:

A/P clerk produces A/P check for $20.  They spend $1.25 to mail it out – one week later vendor calls to say that they have not received the check – vendor asks that a stop payment order be put on the check – they don’t because the bank would charge $30 in bank fees to stop the payment on the $20 check.  Client voids the check in their ERP system – and they send another $20 check to the same vendor via mail.  At month end, they receive their Bank Statement and both checks have been cashed – one for $20 and one for $20,000.  Vendor swears that it wasn’t them that “doctored” the $20 check and made it $20,000 – our Bank says that they will launch an investigation – but it could take a few months to get to the bottom of things.  What a mess.

Thankfully, with our implementation of GP 2010 in the Pinnacle office, I can avoid running into these types of problems.

Process before GP 2010:  Print the check.  Stuff the check in an envelope.  Mail the check.  (Hope it’s actually received…)

Again, take into account the time and materials it takes to do this process:

Time:

  • Print the check
  • Fold and stuff check into the envelope
  • Put a label and postage on the envelope
  • Mail the envelope

Materials:

  • Check
  • Envelope
  • Stamp

Bridging the gap with GP 2010:  Quickly and easily upload 1 ACH file from GP 2010 to your bank to pay all vendors.  Besides the money going directly to the Vendors (which they like), my outstanding check list for my Bank Reconciliation at Month End is well – no longer needed – because there aren’t any outstanding checks.

We keep coming back to this theme of quick and easy.  I’m excited about our implementation of these features into our accounting system, and even more so, I’m excited about the money we will be saving by cutting back on materials and the time it has taken each month to both send invoices and pay vendors.

These are only a few of the many cool new features in Microsoft Dynamics GP 2010.  We will be showcasing some of these features in further blog articles.