0

From the one side, customer can order "I need products list on /products and conversion statistics on /statistics/conversion". In this case, we need to obey in and write something like:

const RoutingData: { [routeID: string]: Route } = {
  products: {
    URN: "/products",
    queryParameters: {
      category: "CATEGORY",
      tag: "TAG"
    }
  },
  conversion: {
    URN: "/conversion"
  }
}

I suppose, in this case the routing is the Business Rules, because the customers wants it and it will bring the income to customer (at least, the customer thinks as such).

From the other side, the routing is just the Web application feature, but the Business rules must not know about implementation method like Web or Native.

Just in case, I'll remind the Clean Architecture terminology:

enter image description here

4 Answers 4

1

I suppose, in this case the routing is the Business Rules, because the customers wants it and it will bring the income to customer (at least, the customer thinks as such).

Going by this reasoning, every single line of code in the software would become a Business Rule, as every single line of code should ultimately be traceable to a wish of the customer (even if that wish is as generic as "write me an application to ease the administration of X").

If the customer asks you to ensure printers of model X are supported, that does not make Printing suddenly a Business Rule. It just means that those printers are devices they already have and they don't want to increase the project's costs by having to buy new printers.

Business Rules are things that make the business tick and that would remain unchanged even if the system you deliver is not made out of software but an army of clerks with paper forms and filing cabinets.

1

Routing, from a web application perspective, is just fancy-talk for "which use case gets executed when this URL is invoked?" Once you translate a URL to a piece of code, which might be a controller in an MVC framework, the routing part of the application is done.

Even if a controller issues an HTTP redirect, the routing infrastructure is what creates the redirect response. The routing infrastructure also translates that redirect URL back to another piece of code.

Routing URLs to code is an artifact of a web application or API, and to me this puts routing in the middle between to the user interface and web portions of the external interfaces in clean architecture.

0

Application routing is based on construction.

When the URN hits the Web Interface it calls the Interface Adapter it was configured to call when it was constructed. Which calls the App Business Rule it was configured to call. Which calls the Enterprise Business rule it was configured to call.

It's true that the inner layers don't know about the outer layers. But the connections between these layers aren't random. The construction code knew about all of them.

So the answer is: "all of the above, and more".

0

My conclusion after information collection

No, routing is not the any kind of Business rules.

Routing in client-server interaction

In this case, routing in just the agreement between client and server, how client must ask the server for specific HTML Page or Data. Among the design patters I know, the Routing the Contract.

Note that there are some alternatives to traditional routing like GraphQL has been developed, so the routing is just one of the methods to request the data from client side.

Front-end routing in SPA like "vue-router"

Here, the routing is just the method of multiple pages effect simulation. We can simulate this effect without touching the URN - just remove one page component from DOM and append the another one. The approaches similar to vue-router are more declarative: we set which component must be mounted when URN will change.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.