Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
MuleSoft for Salesforce Developers

You're reading from   MuleSoft for Salesforce Developers A practitioner's guide to deploying MuleSoft APIs and integrations for Salesforce enterprise solutions

Arrow left icon
Product type Paperback
Published in Sep 2022
Publisher Packt
ISBN-13 9781801079600
Length 490 pages
Edition 1st Edition
Arrow right icon
Authors (3):
Arrow left icon
Arul Christhuraj Alphonse Arul Christhuraj Alphonse
Author Profile Icon Arul Christhuraj Alphonse
Arul Christhuraj Alphonse
Alexandra Martinez Alexandra Martinez
Author Profile Icon Alexandra Martinez
Alexandra Martinez
Akshata Sawant Akshata Sawant
Author Profile Icon Akshata Sawant
Akshata Sawant
Arrow right icon
View More author details
Toc

Table of Contents (21) Chapters Close

Preface 1. Part 1:Getting Started with MuleSoft
2. Chapter 1: Introduction to APIs and MuleSoft FREE CHAPTER 3. Chapter 2: Designing Your API 4. Chapter 3: Exploring Anypoint Studio 5. Chapter 4: Introduction to Core Components 6. Chapter 5: All About Anypoint Platform 7. Part 2: A Deep Dive into MuleSoft
8. Chapter 6: Learning DataWeave 9. Chapter 7: Transforming with DataWeave 10. Chapter 8: Building Your Mule Application 11. Chapter 9: Deploying Your Application 12. Chapter 10: Secure Your API 13. Chapter 11: Testing Your Application 14. Part 3: Integration with Salesforce and Other Connectors
15. Chapter 12: MuleSoft Integration with Salesforce 16. Chapter 13: MuleSoft Connectors and Use Cases 17. Chapter 14: Best Practices, Tips, and Tricks 18. Chapter 15: Certification and Interview Tips 19. Index 20. Other Books You May Enjoy

Exploring application networks and the API-led connectivity approach

This is where it all comes together. We understand that MuleSoft is a collection of low-code technologies that help us create APIs or microservices based on Mule applications. Integrations are important because we can connect different services with different data types or structures to create an application network.

Understanding what application networks are

Why do we create several APIs and connect them instead of creating one single system to do all of this? Remember the benefits of using APIs: loosely coupled, governance, discoverability, easier maintenance, efficiency, and reusability. We can’t achieve these with a regular system. All the code is tightly coupled, it’s hard to maintain, it can’t be reused, and so on. This is why we want to create an application network to connect all of these different building blocks.

Figure 1.4 – Application network representation

Figure 1.4 – Application network representation

We can connect services or platforms such as Salesforce, Workday, Amazon Web Services, NetSuite, Dropbox, Google Drive, SAP, and Twitter – the options are endless. Even if these don’t have an API to connect to as easily, MuleSoft’s products offer so many options for customization that you can really integrate almost anything with MuleSoft. The main vision when MuleSoft was created was to be able to work together and make more APIs to discover and reuse. This would essentially reduce time to delivery and IT demands would be easier to meet over time. But how exactly do we plan on doing this network? This brings us to our next point.

Analyzing the API-led connectivity approach

MuleSoft believes in an architectural approach in which you have a standard to give your APIs a specific purpose in your application network. This can help you create more reusability around your APIs so you can easily add new functionality or APIs, modify or upgrade existing ones, or remove any API that’s no longer being used.

This API-led connectivity approach is based on three different layers in which we’ll categorize our APIs: Experience, Process, and System.

Figure 1.5 – The three layers of the API-led connectivity approach: Experience, Process, and System

Figure 1.5 – The three layers of the API-led connectivity approach: Experience, Process, and System

Experience layer

This is the top layer. It is where we have the APIs that directly make contact with the client application, whether that’s a mobile application or a desktop application. This is where we put the APIs that have direct contact with the outside world, that is, the APIs that are public. The sole purpose of these Experience APIs is to connect to the client application and send the information to the next layer. The only logic we may add here is any kind of security or filter to make sure the information that is received is correct and can indeed proceed with the rest of our application network. If anything is missing or looks suspicious, then it’s the Experience API’s responsibility to not let this data proceed further and raise this as an error immediately.

Process layer

This is the middle layer. It is where we, as its name suggests, process or transform the data we received from the Experience layer in order to be sent to the rest of the APIs. Just as we saw earlier on in this chapter when we talked about integrations, if we have system A, which processes certain information, and then we have system B with a different data structure, then it’d be the responsibility of the Process APIs to transform (or translate) these two data types in order to be understandable by their corresponding APIs.

Going back to our previous example, say now system A is the data that comes from the client application and system B is the data that we need to send to the server application; we end up with something like this:

client-application.json

{
"ID": 1,
"FirstName": "Alexandra",
"LastName": "Martinez"
}

server-application.json

{
"id": 1,
"firstName": "Alexandra",
"lastName": "Martinez"
}

It is the Process API’s responsibility to do these two transformations both upstream and downstream. The Process API would first receive client-application.json as its input, then it would have to transform it to the server-application.json structure and send it to the corresponding API. After the downstream API responds, the Process API needs to transform the data from whatever it received from the server application to whatever data type or structure the client application is expecting to receive. In this case, the client application would be the Experience API that’s calling the Process API, and the server application would be the System API.

System layer

This is the last layer. The Experience layer, the topmost layer, is the one that directly connects to the client application. Now that we’re at the bottom, this is where we directly connect to the server application, whether that is Salesforce, Facebook, SQL, or Azure, you name it. These APIs are where we store any tokens, passwords, credentials, or URLs that are needed to connect to the underlying systems.

Since most of the filtering, security, cleanup, and transformations are done in the previous layers, this layer can focus solely on connecting and sending the data to its target. If there is more data transformation needed from this response, the Process API is responsible for doing so, not the System API.

We have a better picture now of how the API-led connectivity approach is helpful for our application network – when we separate the APIs into these three layers, we have a better standard to follow in our architecture. Now, let’s summarize all we have learned in this chapter.

You have been reading a chapter from
MuleSoft for Salesforce Developers
Published in: Sep 2022
Publisher: Packt
ISBN-13: 9781801079600
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image