I designed the concept of method routing from my constant frustration of creating new pathways to functionality hubs (like Web APIs and Databases). When I was programming each call to the Web API I would build a
After pursuing a solution for years, I developed a solution for the typical Microsoft Stack of technologies. Here is the stack:
1. Call to a Web API with 1 Controller/ 1 Method (ReST) with QueryString (Stringified JSON)
2. Read Method Information and Parameter Values from QueryString casted to JSON
3. Execute Method, Return JSON from Database
In my estimations, using the method routing design will reduce the time for developing new features and functionality by over 50%. This design will also significantly reduce the requirements for unit testing (code coverage is impacted negligibly, due to the reusability of the functional methods).
Front-End Technology Agnostic
Since the driving force for the Method Routing is the json object as a query string, any web page tech can call a web method empowered with Method Routing.
At the heart of this design is the simplification of the layering between data and request <-> display. Much of modern system design is abstraction and services: event driven, distributed. However this has constricted the velocity of feature development by requiring the mapping of data created from external sources.
Accessibility does not mean assessible. On a project that I work on, there was a requirement to create JSON objects for submission to Salesforce. The data sources were a number of 'micro-services' that produced generic data models. This placed the burden on me to not only request the data from each of the seperate data sources and then retrieve the applicable data fields required for populating the Salesforce JSON schema object.
BUT, web applications are not extensions of microservices they are Client/Server applications that provide user interfaces to interact with data and system processing.
As a Client<->Server Application, the front-end needs to access data stored for consumption. A mistake that many make in modern development is to carry forward the process of manufacturing data 'On-Demand'. Much time and coordination was mandated, within the monolith structure, for the optimization of data extraction and transformation, while the user waits.
I am reminded of advancements within the 'Fast Food' industry, in the 50's and 60's. Although, not perfect, the solutions for providing good food, fast, was to do one of the following:
In keeping with this analogy, data can be manufactured
EXAMPLE:
Web Controller:
Single Controller Providing ReSTful Methods
Each Method will accept a JSON Object based on a JSON Schema Interface
public class MethodRouting
{
public dynamic ProcessRequest(string JsonPayload)
{
JObject jObject = JObject.Parse(JsonPayload);
string methodName = jObject["methodName"].ToString();
DataProcessing dataProcessing = new DataProcessing();
MethodInfo methodInfo = dataProcessing.GetType().GetMethod(methodName);
var parameterLength = methodInfo.GetParameters().Count();
var methodParameters = new object[parameterLength];
var parametersRequest = jObject["parameters"];
for (int i = 0; i < parameterLength; i++)
{
methodParameters.SetValue(parametersRequest[i], i);
}
methodInfo.Invoke(dataProcessing, (parameterLength == 0) ? null : methodParameters);
}
}
“To reach the masses, some sort of big organization (whether) domestic and foreign branch affiliation, is not necessary. To reach the growing number of students, some sort of pre-conformed members will be conditioned according to the prescribed system. Many will probably end up as a prisoner of a systematized drill."
Copyright © 2023 Fundamental Technology - All Rights Reserved.
Powered by GoDaddy
A Place to Explore Programming that is Efficient and Elegant. Frame(s)work is designed for those looking to interact directly with HTML5.
We use cookies to analyze website traffic and optimize your website experience. By accepting our use of cookies, your data will be aggregated with all other user data.