Object-oriented design: a responsibility-driven approach
OOPSLA '89 Conference proceedings on Object-oriented programming systems, languages and applications
Design patterns: elements of reusable object-oriented software
Design patterns: elements of reusable object-oriented software
Endo-testing: unit testing with mock objects
Extreme programming examined
Patterns of Enterprise Application Architecture
Patterns of Enterprise Application Architecture
JMLC '00 Proceedings of the Joint Modular Languages Conference on Modular Programming Languages
Mirrors: design principles for meta-level facilities of object-oriented programming languages
OOPSLA '04 Proceedings of the 19th annual ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications
Six Learning Barriers in End-User Programming Systems
VLHCC '04 Proceedings of the 2004 IEEE Symposium on Visual Languages - Human Centric Computing
The Factory Pattern in API Design: A Usability Evaluation
ICSE '07 Proceedings of the 29th international conference on Software Engineering
Google Guice: Agile Lightweight Dependency Injection Framework (Firstpress)
Google Guice: Agile Lightweight Dependency Injection Framework (Firstpress)
Dependency Injection
Embedding languages without breaking tools
ECOOP'10 Proceedings of the 24th European conference on Object-oriented programming
Modules as objects in newspeak
ECOOP'10 Proceedings of the 24th European conference on Object-oriented programming
Magritte: a meta-driven approach to empower developers and end users
MODELS'07 Proceedings of the 10th international conference on Model Driven Engineering Languages and Systems
Hi-index | 0.00 |
Unit testing is often made more difficult by the heavy use of classes as namespaces and the proliferation of static methods to encapsulate configuration code. We have analyzed the use of 120 static methods from 96 projects by categorizing them according to their responsibilities. We find that most static methods support a hodgepodge of mixed responsibilities, held together only by their common need to be globally visible. Tight coupling between instances and their classes breaks encapsulation, and, together with the global visibility of static methods, complicates testing. By making dependency injection a feature of the programming language, we can get rid of static methods altogether. We employ the following semantic changes: (1) Replace every occurrence of a global with an access to an instance variable; (2) Let that instance variable be automatically injected into the object when it is instantiated. We present Seuss, a prototype that implements this change of semantics in Smalltalk. We show how Seuss eliminates the need to use class methods for non-reflective purposes, reduces the need for creational design patterns such as Abstract Factory and simplifies configuration code, particularly for unit tests.