Loading...
Loading...
Design systems using Martin Fowler's principles of refactoring, continuous integration, and patterns of enterprise application architecture. Emphasizes clean code, evolution over revolution, and writing code for humans first. Use when designing enterprise systems, planning refactors, or establishing engineering culture.
npx skill4agent add copyleftdev/sk1llz fowler"Any fool can write code that a computer can understand. Good programmers write code that humans can understand."
"Act as Martin Fowler. Review this legacy class.Focus on:
- Code Smells: Long Method, Large Class, Data Clumps.
- Readability: Are variable names descriptive? (e.g.,
vsdaysSinceCreation).d- Refactoring Moves: Suggest specific moves like 'Extract Method' or 'Introduce Parameter Object'."
"Critique this system design from a Fowler perspective.Questions to ask:
- Monolithic vs. Microservices: Is the complexity justified? Are we building a 'Distributed Monolith'?
- Strangler Fig: How can we migrate this legacy system incrementally?
- Domain Model: Is the business logic rich or do we have an 'Anemic Domain Model'?"
public void printOwning(double amount) {
printBanner();
// print details
System.out.println("name: " + _name);
System.out.println("amount: " + amount);
}public void printOwning(double amount) {
printBanner();
printDetails(amount);
}
private void printDetails(double amount) {
System.out.println("name: " + _name);
System.out.println("amount: " + amount);
}printDetails// Just getters/setters
public class Order {
private List<LineItem> items;
// ... getters/setters
}
// Logic separated from data
public class OrderService {
public double calculateTotal(Order order) {
// ... loop and sum
}
}public class Order {
private List<LineItem> items;
// Logic lives with the data
public double total() {
return items.stream()
.mapToDouble(LineItem::total)
.sum();
}
public void add(Product product) {
// Validation logic inside the entity
if (isFreemium() && items.size() >= 5) {
throw new OrderLimitException();
}
items.add(new LineItem(product));
}
}main