1. The document discusses strategies for optimizing software costs, including the costs of introduction, change, and ownership over the lifetime of a project.
2. It emphasizes focusing on optimizing for cost of introduction early on, as this cost is relatively easy to optimize and loses relevance over time. However, cost of change increases exponentially and is most important to optimize for longer-term projects.
3. Cost of ownership involves ongoing maintenance and allows balancing the costs of introduction and change by selectively taking ownership of only necessary logic through techniques like testing and refactoring.
11. Actually in this talk
1. Introducing & making sense of development costs
2. Highlighting the context of tools & practices we use
3. Years of observation & experience, not data
collection and analysis
15. Software Costs
1. Time to write & test code
2. Time to change code & tests
3. Time to refactor code & tests
16. Software Costs
1. Time to write & test code - Cost of Introduction
2. Time to change code & tests - Cost of Change
3. Time to refactor code & tests - Cost of Ownership
24. Service Locator
// --- Explicit Dependency
public function __construct(Cache $cache) {
$this->cache = $cache;
}
public function index() {
$photos = $this->cache->get('photos');
// ...
}
// --- "Laravel Facade"
public function index() {
$photos = Cache::get('photos');
// ...
}
25. Base Class
// --- Base Controller
class MyController extends Controller
{
public function indexAction()
{
$homepageUrl = $this->generateUrl('homepage');
// ...
}
}
27. Active Record
// --- Custom Mapping
class DbalCustomerRepository implements CustomerRepository
{
public function findCustomerWithName($name) {
// ...
}
}
// --- Eloquent
use IlluminateDatabaseEloquentModel;
class Customer extends Model
{
// ...
}
28. Event Dispatcher
// --- Event Subscriber
interface MyListener {
public function emailWasSent($email, $text);
}
// ...
public function sendEmail() {
// ...
$this->myListenerInstance->emailWasSent($email, $text);
}
// --- Event Dispatcher
$eventDispatcher->dispatch('email.sent', new Event($email, $text));
29. Dependency Injection Container
// --- Dependency Inversion Principle
$contoller = new MyController(
new Router(),
new Cache(new Configuration())
);
// --- Dependency Injection Container
$controller = $container->get('controller.my');
30. No matter what you think,
optimising for CoI (Cost of
Introduction) is not inherently a
bad thing.
54. Cost of Ownership
Time it takes to maintain the
owned application logic to
support its ongoing change.
55. Attributes
— Intermediate between Cost of
Introduction & Cost of
Change
— Has no direct correlation to
business value
— Has direct correlation to LOC
57. Cost of Ownership is the cost you
pay for the right to change a
particular part (module, class,
method) of application
continuosly and sustainably.
74. But you don't know what's worth
owning at the beginning of the
project.
75. Software Costs recap
1. Cost of Introduction - Linear. Relevant at the
beginning. Very easy to optimise for.
2. Cost of Change - Exponential. Relevant everywhere
except the beginning. Hard to optimise for.
3. Cost of Ownership - Linear. Relevant throughout.
Owning the wrong thing is bad.