Google Testing Blog: Write Change-Resilient Code With Domain Objects
Although a product's requirements can change often, its fundamental ideas usually change slowly. This leads to an interesting insight: if we write code that matches the fundamental ideas of the product, it will be more likely to survive future product changes. Domain objects are building blocks (such as classes and interfaces) in our code that match the fundamental ideas of the product. Instead of writing code to match the desired behavior for the product's requirements ("configure text to be white"), we match the underlying idea ("text color settings"). For example, imagine you’re part of the gPizza team, which sells tasty, fresh pizzas to feed hungry Googlers. Due to popular demand, your team has decided to add a delivery service. Without domain objects, the quickest path to pizza delivery is to simply create a deliverPizza method: public class DeliveryService { public void deliverPizza(List pizzas) { ... } } Although this works well at first, what happens if gPizza expands
Google Testing Blog: Write Change-Resilient Code With Domain Objects Testing Blog Write Change-Resilient Code With Domain Objects Wednesday, September 04, 2024 Google Labels: Amy Fu , Code Health , TotT    Labels  TotT 113 GTAC 61 James Whittaker 42 Misko Hevery 32 Code Health 31 Anthony Vallone 27 Patrick Copeland 23 Jobs 18 Andrew Trenk 13 C++ 11 Patrik Höglund 8 JavaScript 7 Allen Hutchison 6 George Pirocanac 6 Zhanyong Wan 6 Harry Robinson 5 Java 5 Julian Harty 5 Adam Bender 4 Alberto Savoia 4 Ben Yu 4 Erik Kuefler 4 Philip Zembrod 4 Shyam Seshadri 4 Chrome
Explore this link on the map →related reading
- Stevey's Google Platforms Rant · GitHubgist.github.com
- Impeccable: The missing upgrade to Anthropic's impeccable skillimpeccable.style
- Notionnanransohoff.com
- llm-wiki · GitHubgist.github.com
- GitHub · Change is constant. GitHub keeps you ahead. · GitHubgithub.com
- Paul Buchheit: Communicating with codepaulbuchheit.blogspot.com
- Google Testing Blog: Less Is More: Principles for Simple Commentstesting.googleblog.com
- Google Testing Blog: Simplify Your Code: Functional Core, Imperative Shelltesting.googleblog.com
- Prompt guidance | OpenAI APIdevelopers.openai.com
- The Joel Test: 12 Steps to Better Code – Joel on Softwarejoelonsoftware.com
- Google Testing Blog: Code Healthtesting.googleblog.com
- ObservableObject | Apple Developer Documentationdeveloper.apple.com