Skip to main content

Command Palette

Search for a command to run...

What AI Gets Wrong About Enterprise Java

Updated
5 min readView as Markdown
B
Senior Software Architect with 30+ years of experience building enterprise systems using Java, Spring Boot, and cloud-native technologies.

Artificial Intelligence has become incredibly good at writing Java.

Ask it to generate a Spring Boot REST API, optimize a stream operation, explain virtual threads, or migrate Java 17 code to Java 21—it performs surprisingly well.

But here's the uncomfortable truth.

The better AI becomes at writing Java, the easier it is to forget that enterprise Java isn't really about writing Java.

It's about understanding decades of architectural decisions, business constraints, regulatory requirements, operational realities, and organizational trade-offs.

After spending years building enterprise systems, I've realized that AI still misunderstands many of the things that actually matter.

Here are some of the biggest gaps.


1. AI Optimizes Code Instead of Systems

Ask AI to improve a method, and it usually succeeds.

It will:

  • Reduce duplication

  • Simplify conditions

  • Improve readability

  • Suggest newer APIs

  • Increase test coverage

All valuable improvements.

But enterprise applications rarely fail because a method wasn't elegant.

They fail because:

  • services become tightly coupled

  • dependencies grow uncontrollably

  • ownership becomes unclear

  • boundaries drift over time

  • business capabilities overlap

These aren't coding problems.

They're architectural problems.

A perfectly optimized class inside a poorly designed architecture is still technical debt.


2. AI Assumes Greenfield Projects

Most AI-generated examples quietly assume you're building something new.

Enterprise Java is almost never greenfield.

Instead, you're dealing with:

  • 15-year-old Spring applications

  • legacy SOAP integrations

  • Oracle stored procedures

  • shared databases

  • regulatory constraints

  • nightly batch jobs

  • applications that cannot experience downtime

AI often recommends:

"Rewrite this."

Real enterprise architects usually ask:

"How do we migrate this safely over the next three years?"

Those are completely different questions.


3. AI Doesn't Understand Organizational Architecture

Enterprise systems reflect organizations.

Conway's Law still applies.

Sometimes a service exists not because it's technically ideal, but because:

  • another department owns it

  • another vendor maintains it

  • another team deploys it

  • legal requirements demand separation

  • different release schedules exist

AI tends to recommend consolidation.

Reality often requires coordination.

Ignoring organizational boundaries creates more problems than technical ones.


4. AI Underestimates Non-Functional Requirements

Functional code is easy.

Enterprise software succeeds because of everything surrounding the code.

For example:

  • resilience

  • observability

  • auditability

  • traceability

  • disaster recovery

  • compliance

  • security

  • performance under load

A generated REST controller may compile perfectly.

But does it support:

  • distributed tracing?

  • structured logging?

  • GDPR requirements?

  • rate limiting?

  • multi-region deployment?

  • zero-downtime releases?

  • operational dashboards?

Usually not.

Enterprise engineering is mostly about these "invisible" requirements.


5. AI Doesn't Know Why Technical Debt Exists

Developers often ask:

"Why didn't they just refactor this?"

AI usually agrees.

But experienced engineers know technical debt often has history.

Maybe:

  • a customer deadline forced a shortcut

  • regulations changed unexpectedly

  • the business model evolved

  • acquisitions introduced incompatible systems

  • migration budgets disappeared

Every ugly piece of code has a story.

AI sees bad code.

Experienced architects see decisions made under constraints.

Understanding that difference matters.


6. AI Loves Patterns More Than Trade-offs

AI can explain every design pattern.

Strategy.

Factory.

Decorator.

Hexagonal Architecture.

CQRS.

Event Sourcing.

Clean Architecture.

But enterprise architecture is rarely about choosing the "best" pattern.

It's about choosing the least expensive compromise.

Sometimes a simpler solution wins because:

  • fewer engineers understand CQRS

  • operational costs matter

  • debugging becomes easier

  • onboarding is faster

  • delivery speed increases

Good architecture isn't maximizing elegance.

It's optimizing outcomes.


7. AI Doesn't Experience Production

Production changes how engineers think.

After enough incidents, you stop asking:

"Is this elegant?"

Instead you ask:

"What happens at 2 AM?"

Can support engineers diagnose it?

Will monitoring detect it?

Can it be rolled back?

How long will recovery take?

AI has read countless postmortems.

Experienced engineers have lived through them.

Those experiences shape architectural decisions in ways documentation never captures.


8. AI Doesn't Understand Business Context

Enterprise Java exists to solve business problems.

Not technical ones.

Two systems with identical code may require completely different architectures because:

  • one processes insurance claims

  • another settles financial trades

  • another manages healthcare records

  • another supports e-commerce during peak shopping seasons

The Java code looks similar.

The business risk does not.

Architecture always follows business priorities.

AI often starts from technology.

Experienced architects start from the business.


So...Should We Trust AI?

Absolutely.

AI has become one of the most productive engineering tools we've ever had.

I use it every day.

It accelerates:

  • coding

  • testing

  • documentation

  • refactoring

  • debugging

  • code reviews

  • knowledge discovery

But we should remember what AI actually optimizes.

It predicts good code.

Enterprise software requires good judgment.

And judgment comes from context.

Context about people.

Context about history.

Context about operations.

Context about the business.

Those are still human strengths.

Perhaps the future of enterprise Java isn't AI replacing architects.

It's architects who know how to give AI the right context.

Because in enterprise software, the hardest problems were never about writing Java.

They were always about understanding everything around it.


What do you think?

Where have you seen AI struggle the most in enterprise Java projects?

I'd love to hear your experiences.

More from this blog

B

Bill LIao's Blog

137 posts

A technical blog on modern backend development, software architecture, and practical AI agent workflows