I write Engineering Topic weekly...?

Blog of web engineer at Tokyo. [Japanese version] http://taichiw.hatenablog.com/

Any System's behavior can be described by only "Input" & "Output"

Even it's any size or any type, system's behavior can be described by only "Input" and "Output'.

Subroutines in program (function, method, ...)

The behavior can be described by requested parameter and returned value.

public String greet (String name){
    return "Hello " + name + "!";

Each services in microservice architecture

It can be explained by API's request and response.

Whole system's behavior on microservice architecture

With perspective that whole system is one of huge black box, we can explain that by the published API's request and response.

Web page

Possible to explain by URL (and posted contents) as request and returned HTML and some contents as response.

But... does some system update the data, doesn't it?

Yes, we need say "the status is updated" for describing the behavior if we think this "System" is consists from one service and database.

But with another perspective, if we think only the service is system... then we can say, the request to Database is also just one of output from the service.

In that way, we can say this system just has two kind of output.

We can adapt same idea to subroutine on program.

class Person {
  String name;
  public setName(String name) {
    this.name = name;

We can understand this code like this...

but this is also possible.

The case get data from database

In this case, we can say just this service has two kind of input.