3 ms·
What is your imperative language? Do you write imperative code in OOP? Do you find yourself compelled to implement everything with static methods?
by vladimirralev 13y ago
What is your imperative language? Do you write imperative code in OOP? Do you find yourself compelled to implement everything with static methods?
- mbrock 13y agoI currently work with Java. This codebase employs a kind of pseudo-OOP, according to a pattern that I think is at least somewhat popular. Data is mostly represented by objects with only getters and setters. Business logic is contained in "services," which are basically stateless singletons (handled by dependency injection). The best code in the system, IMO, consists of small stateless singletons with clear dependencies and non-modifying operations. This code often comes out of test-driven development and has tests that read like specifications.