Tech
2025-07-16
Why is it important to design an API according to business design?

Table of contents

What I'm going to introduce in this content is from a business perspective, from business design to package design and controller design at the source level.

Before explaining the “business dashboard” currently newly developed in APM, I will explain in detail how IT is designed and developed as a whole to make management easier in the future. I'll explain how to design a RESTful API when designing a business, why it should be designed this way, and the advantages of designing this way.

Structuring a URL based on 1 to 2 depths when designing a businessSilver A reasonable method that is also widely used in practiceThis is it. In particular, when designing RESTful APIs, this approach often naturally leads to a business domain-centered structure. In particular, from the perspective of developers and operators, it is often possible to quickly deal with problems when analyzing transactions or analyzing faults because they are often able to distinguish what kind of work they are doing even if they only look at a specific URL.

👍 Advantages of designing based on URL depth


Business domain-centered design

Below is a structure that clearly shows what resources are in a domain when designed around a business.


Below is a structure where a domain cannot be linked to a business.


What do you think when you see the two examples above?

I'm looking at the two above, and I definitely think the top part is clearly visible. Below, it's not clear whether this is account logic or the auth part. In fact, during my social life, I was pressed for time when designing products, but when I think about it now, I think maintenance was often difficult compared to actually developing quickly due to the large number of hours required to find problems later.

If you watch Eagle, I don't want you to just develop it like me. Also, I recommend that you think a little bit about the importance of design and develop it ^^

⚠️ Points to note - Don't mix with a focus on function

If you look at the bad example above, I created a mix of features and domains. When designing an API, you need to be clear. Some features come first, the domain comes later, and in others, the domain comes first, and if you do this, maintenance becomes difficult.


What do you think? I like the bottom part. I know it's an order right away, and I can see what to look for after that, but if you take a close look at the part above, you'll know, but if you mix it up like “orderDelete” for the 3rd time, I'll roll my head over it again.

✅ Package structure example


I talked about RESTful API design above, and this is the package structure for that part. I made a simple package. This is a general structure that receives an API from the controller and processes business logic at the Service end.

Accounts, customers, cards, auth, etc. belong to the domain. If you call /account/100 and a 500 error occurs, you should quickly determine why. Developers will probably find /account through a search in their IDE (Integrated Development Environment). However, if accounts can exist in other Controllers and are used not only in Contoller but also in Services and various Util, it won't be easy to find them.

However, if you place a Controller under the domain as shown above, you can immediately search for AccountController as soon as you see /account/..., so quick maintenance is possible.

✅ 1. Controller example


✅ 2. Service example


✅ 3. DTO examples

AccountResponse.java


✅ 4. Repository example


✅ Clean up: call flow


✅ Finishing arrangement

  • Designing based on 1 to 2 depths of the URL and dividing the controller/class/package accordingly is a very good design method.
  • When designing a package, design it around a domain so that it can be mapped 1:1 with the URL structure.
  • actually Domain Driven Design (DDD)me RESTful API designIt is also used a lot in
  • However, rather than bundling by depth alone Cohesiveness in the business domainThe key is to consider and split it appropriately.

Why did I explain everything from business design to development? Of course, this is because WhaTap monitors from a business perspective! ^^

Now, we've opened a new menu called “Business Dashboard” in WhATap APM. The details of business monitoring How should I monitor my business?I will guide you in detail at

Experience Monitoring with WhaTap!