AETERNAE AI RESEARCH LLC INDEPENDENT RESEARCH
ÆAETERNAERESEARCH
Sign inRequest access
← Malware catalog

Attributed metadata history

REPORTPUBLIC METADATA

SOLID Principles in Java: The Definitive Guide with Examples

SOLID is a set of five principles that tell you how to arrange your code into classes and how those classes should depend on each other. Code that follows them is easier to change, test and understand, because a change in one place doesn't ripple through the rest of the system. The five principles are: Single Responsibility Principle Open-Closed Principle Liskov Substitution Principle Interface Segregation Principle Dependency Inversion Principle Robert C. Martin described them in the early 2000s, building on earlier work by Bertrand Meyer and Barbara Liskov, and Michael Feathers arranged them into the acronym SOLID. This guide explains all five with one running example, an online store that issues payment cards to its customers. Each principle starts with code that breaks it, shows the problem, and then fixes it. All the code is Java, and I compiled and ran every example on Java 25. S: Single Responsibility Principle A module should be responsible to one, and only one, actor. -- Robert C. Martin, Clean Architecture The principle is often summarized as "a class should have only one reason to change". The reason to change is a group of people, an actor, who ask for changes. If two teams can ask for changes to the same class, that class has two responsibilities, and sooner or later one team's change will break the other team's code. The problem: two teams, one class The store applies interest to customers whose payment is late, and it locks their cards. At first, the Payments team and the Cards team agree on the same rule: both actions happen when a payment is 14 or more days late. So one class does both: public class Payment { public static final int MAX_DAYS = 14; public void batch(List<Customer> customers) { for (Customer customer : customers) { if (latePaymentDays(customer) >= MAX_DAYS) { applyLatePaymentInterest(customer); lockCard(customer); } } } // latePaymentDays, applyLatePaymentInterest and lockCard omitted } Then the Cards team wants to lock cards after 10 days, to reduce fraud. The Payments team doesn't want to charge interest earlier, because its rules come from the customer contracts. Both requirements live in the same MAX_DAYS constant and the same if. Whatever value you choose, one team gets the wrong behavior. The teams are stuck, and every change to Payment needs both of them to agree. The solution: one class per actor Give each team its own class. The calculation that both teams need, how many days a payment is late, is a fact about the customer and not either team's policy, so it moves to a third class that both use: public class PaymentHistory { private final LocalDate today; public PaymentHistory(LocalDate today) { this.today = today; } public int latePaymentDays(Customer customer) { if (customer.paid()) return 0; return (int) Math.max(0, ChronoUnit.DAYS.between(customer.dueDate(), today)); } } The Payments team owns the interest rule: public class LateInterestBatch { public static final int MAX_DAYS = 14; private final PaymentHistory history; public LateInterestBatch(PaymentHistory history) { this.history = history; } public void run(List<Customer> customers) { for (Customer customer : customers) { if (history.latePaymentDays(customer) >= MAX_DAYS) { applyLatePaymentInterest(customer); } } } } And the Cards team owns the lock rule, with its own threshold: public class CardLockBatch { public static final int MAX_DAYS = 10; private final PaymentHistory history; public CardLockBatch(PaymentHistory history) { this.history = history; } public void run(List<Customer> customers) { for (Customer customer : customers) { if (history.latePaymentDays(customer) >= MAX_DAYS) { lockCard(customer); } } } } With three customers whose payments

Reference details

Source category
research-report
First reported
Nov 24, 2026 17:30 UTC
Last reported
Nov 24, 2026 17:30 UTC
Catalog updated
Nov 24, 2026 17:33 UTC
Record ID
e0f750a7942c95fb22758c61a7060f4fcf41c9aaac4fca9b93c91f9d85246371

Published indicators

Network indicators are visibly defanged. This page does not make them clickable or send them to another service.

No validated file hashes or network indicators are stored for this record.

Source observations

intelligence_src_6dc544294b7f21f98a

Source-provided label
Publisher RSS metadata
Evidence class
mentioned in report
Confidence
Not reported
Observed
Nov 24, 2026 17:30 UTC
Retrieved
Nov 24, 2026 17:33 UTC

This record contains metadata and attribution only. It does not host, download, unpack, render, or execute malware samples.

Feed collection status

Sources represented on this page. Publication and observation dates describe the content; successful batch dates describe local collection. A recent batch does not certify complete coverage or current provider availability.

1 sources: 0 stale, 0 needing attention, 0 paused, 0 unverified.

Review source update dates and status
  • intelligence_src_6dc544294b7f21f98aRecent successful batchLast successful batch: Last attempt:

Stale means older than twice the recorded collection interval, with a minimum of one hour; without an interval, the threshold is 24 hours. Cached content remains available while a feed is stale, paused, or unverified.