Quick revision
The short answer
Spring MVC's long life shows that a stable core with good extension points lets new styles, such as REST, functional endpoints, streaming and a return of server rendering, be added without rewrites. So I choose web frameworks for the flexibility of their core and the cost of changing them, including hiring and tooling, and I replace one only when it blocks a real business need, not because of a trend. Keeping API contracts independent of the framework makes a later change of implementation possible without breaking clients.
What to remember
In this answer, we saw that Spring MVC lasted because its core delegates every decision to pluggable strategies, so REST, async, streaming, functional routes and new rendering styles arrived as extensions rather than rewrites. The lessons for choosing frameworks are to value a flexible core, expect fashions to return, replace a framework only when it blocks a measurable business need, count the full cost of change including hiring and tooling, and keep API contracts and business logic independent of the framework so the implementation can change.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Spring MVC's long life shows that a stable core with good extension points lets new styles, such as REST, functional endpoints, streaming and a return of server rendering, be added without rewrites. So I choose web frameworks for the flexibility of their core and the cost of changing them, including hiring and tooling, and I replace one only when it blocks a real business need, not because of a trend. Keeping API contracts independent of the framework makes a later change of implementation possible without breaking clients.
Why this question is asked
Technology leaders face constant pressure to adopt the next framework. The history of Spring MVC is a useful case study: the same DispatcherServlet design served JSP pages in the mid-2000s, REST APIs in the 2010s, and today serves streaming responses, functional routes and HTML fragments for hybrid pages. Interviewers ask this to see whether we can draw principles from that history and apply them to framework decisions. In this answer, we will look at why Spring MVC lasted, what that teaches about choosing frameworks, how to decide when a replacement is justified, and how to keep the option to change open.
1Why Spring MVC Lasted
Spring MVC's core is small and abstract. DispatcherServlet receives requests and delegates every decision to pluggable strategies: handler mappings decide who handles a request, handler adapters decide how to call it, argument resolvers and message converters decide how data goes in and out, and view resolvers decide how pages are rendered. None of these is tied to one way of building web applications.
So when the web changed, Spring added strategies instead of replacing the core. REST support arrived as @ResponseBody and message converters. JSON arrived as a Jackson converter. Async and streaming arrived as new return value handlers for DeferredResult and SseEmitter. Functional endpoints arrived as a new handler mapping and adapter. Each addition was optional, and applications written years earlier kept working.
- Servlet container and filtersthe base, since the start
- DispatcherServletstable front controller
- Handler mappings and adaptersannotations, then functional routes
- Argument resolvers and convertersforms, then JSON, then new formats
- Return value handlingviews, bodies, async, streaming, fragments
5 layers, from the top down. Step through them one at a time.
New styles arrived as new strategies, not as a new core.
2What This Teaches About Choosing Frameworks
The first lesson is to judge a framework by its core and extension points, not by its feature list today. Features age; a design that lets new features plug in ages slowly. When evaluating a framework, we ask how it would accommodate a style it does not yet support, and whether its history shows additions or rewrites.
The second lesson is that fashions return. Server-side rendering was declared obsolete when single-page apps took over, and has come back with HTML fragment approaches and server rendering in JavaScript frameworks. A flexible framework can follow these swings; a framework built around one style forces a migration each time. That argues for frameworks that do not bet everything on the current trend.
3When to Replace a Framework
Replace a framework when it blocks a business need, and only then. Examples of real blocks are a framework that is no longer maintained and stops receiving security fixes, one that cannot meet a measured performance or scaling requirement that matters to the business, or one whose skills have become so rare that we cannot staff the team. A new framework being popular, or more pleasant, is not on that list.
We also measure the full cost of change, not just the rewrite. Rewriting code is the visible part. Behind it are retraining, new shared libraries, new security reviews, rebuilt monitoring and test tooling, a period of lower productivity, and hiring for skills the market may have less of. A rewrite that takes three engineers six months often costs the organisation much more once these are included.
- Does it block a business need we can measure?Yesestimate the full cost of changeNokeep it and use its extensions
- Can an extension or upgrade remove the block?Yesdo that insteadNoplan a replacement
- Count hiring, tooling and retrainingnot just rewrite effort
- Migrate behind stable API contractsservice by service, measured
4 steps in order. Play them, or step through them one at a time.
4Keeping the Option to Change Open
The cheapest way to make a future framework change possible is to stop clients from depending on the framework. If our public API is defined by an OpenAPI contract or a schema, with explicit error formats such as RFC 9457 problem details, then clients do not care whether a Spring MVC controller, a WebFlux handler or something else produces it. Contract tests that run against the service, not against its classes, prove that a new implementation behaves the same.
The same applies inside the service. Business logic that lives in plain service classes, not in controllers, filters or framework-specific annotations, can move to a new web layer with little change. Teams that keep the web layer thin find that even a large framework change becomes a contained project.
5Follow-up questions
Does this mean you would never adopt a new framework?
No. New frameworks are fine for new products where they fit better, or where a measured need exists. The point is that adopting one for a new service and replacing one under an existing product are different decisions with very different costs, and the second needs a business reason.
How do you keep a long-lived framework from becoming legacy?
By upgrading steadily. A stable framework that is kept current gets security fixes, performance improvements and new extension points. One left on a version from five years ago becomes legacy not because the framework failed but because we stopped maintaining our use of it.
How would you evaluate GraphQL for a Spring shop?
As an addition, not a replacement. Spring for GraphQL plugs into the same application, so we can offer a GraphQL endpoint where clients benefit from flexible queries while keeping REST where it works. That is the same lesson again: add a style through extension, and keep contracts explicit.
6Conclusion
In this answer, we saw that Spring MVC lasted because its core delegates every decision to pluggable strategies, so REST, async, streaming, functional routes and new rendering styles arrived as extensions rather than rewrites. The lessons for choosing frameworks are to value a flexible core, expect fashions to return, replace a framework only when it blocks a measurable business need, count the full cost of change including hiring and tooling, and keep API contracts and business logic independent of the framework so the implementation can change.
Open with
What I take from it is that a stable core with good extension points matters more than a long feature list. Spring MVC's DispatcherServlet delegates everything to strategies: handler mappings, adapters, argument resolvers, message converters, view resolvers.
Then, if they want more
So when the web moved to REST, Spring added @ResponseBody and converters; for async it added DeferredResult and SseEmitter handlers; for functional style it added a new mapping and adapter. Applications from ten years ago kept running. And fashions come back, server-side rendering is returning with HTML fragments, so a flexible framework can follow that without a migration.
For replacing a framework, my rule is: only when it blocks a business need I can measure, like no more security fixes, a scaling requirement it can't meet, or skills we can't hire for. Not because something newer is popular.
And before deciding, I'd ask whether an extension or an upgrade removes the block, and I'd count the full cost: rewrite, retraining, shared libraries, monitoring, security reviews and hiring, which is usually several times the rewrite estimate.
The way to keep the option open is to make clients independent of the framework: explicit API contracts, like OpenAPI with problem-details errors, contract tests against the running service, and business logic in plain service classes rather than in controllers. Then changing the framework is a contained project, not a rewrite of everything.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Framework reference, Spring Web MVC
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Spring MVC has been stable for almost twenty years while the web moved to SPAs, REST...": https://scrivio-interview-library.netlify.app/spring-boot/mvc-architecture/743bc3cc88/