Is there an accepted name for a fake object injected via a preprocessor seam?
I am dealing with some old, sloppy C++ code in which there is a structure with a lot of data members and functions. I want to test a class that I have implemented which uses the struct, but this dependency is going to make the unit tests extremely ugly. Inspired by Michael Feather’s discussion of preprocessing seams in Working Effectively with Legacy Code, I am getting ready to solve this problem by faking the ugly structure with the preprocessor (not with inheritance) polymorphism as demonstrated in the following notional code.
Is there a name for this design pattern? [closed]
Closed 10 years ago.
Is it correct to exclude argument names from function prototypes?
I was recently creating a small technical documentation for an application. The document is to be used by newly hired programmers to get acquainted with the application. It is much friendlier than the Javadocs we have, and includes information that usually isn’t being documented.
Derived Class Method Naming
I’m having a hard time coming up with a good naming convention for methods in derived classes that serve the same purpose as the methods in the base class. For example, if both the base class, and the derived class, need to initialize:
The problems with Avoiding Smurf Naming classes with namespaces
I pulled the term smurf naming from here (number 21). To save anyone not familiar the trouble, Smurf naming is the act of prefixing a bunch of related classes, variables, etc with a common prefix so you end up with “a SmurfAccountView
passes a SmurfAccountDTO
to the SmurfAccountController
“, etc.
Choosing between words with different spellings for function names
A question has been bothering me for a while: when developing international projects, it is common sense to use English as the reference language since it is the language that the most people understand.
Term for a Class with Multiple Interfaces
Say I have a class that implements multiple interfaces. I pass the same instance around using a different interface, depending on what the consumer is interested in.
How to explain to your colleages to stop creating packages and classes named “Utils”?
In most of the projects at work it will eventually show up a package, a class (or multiple packages and classes) named “Utils”, where every kind of function is dumped into.
Naming of related classes and interfaces
I have created an ObjectParser
class which parses data into strongly typed objects using an IObjectParserDataSource
as the data source (the data could be an Excel file, text file, array, query string, etc).
Naming a class that does Importing and exporting of data
I’ve been thinking about creating a class that handles importing and exporting of data, and I feel that naming it FooImporterExporter might look too long, I wan’t to see if there’s a name convention that I could use to name it.