Kevin Tysen wrote:According to the regex API, \b is a word boundary and \B is a non-word boundary. But don't know what that means exactly or how to use them.
It means they match to "zero width" parts of the input string, right before or after a word for \b, or otherwise for \B. For instance in the input string "hello world", \b would match at locations 0, 5, 6 and 11, and \B at everything else.
What's "virtual method invocation"?
I believe it refers to a method call in your code, without knowing exactly which method is going to get called until the moment at runtime where the invocation is actually performed. In Java, this is the case with overridden methods. For instance, when you call toString() on an object, you don't actually know if Object.toString() is going to get called, or maybe Subclass.toString(), or maybe even SubSubClass.toString().
In "Object-Oriented Design Principles", it says "Apply object composition principles." What does that mean?
Lots of beginners extend a class when they believe that their class should provide a lot of the same functions, or maybe they extend a class just because they think it's easy. The truth is that you should rarely have need to extend a class at all. Object composition means that instead of extending a class because you need its functions, you keep a member field referencing it instead.
What's the "Singleton design pattern"?
The Singleton pattern is a pattern where you make a class so it can only have one instance at any given time, and this instance is available globally. It should be used rarely, because global state (static fields) give lots of opportunities to introduce bugs in your program.
What's the "DAO pattern"?
I don't know exactly, I believe it stands for Data Access Object, and it refers to making objects out of entries usually found in databases, to manipulate them more easily. Do a Google search.
"Design and create objects using a factory" Does that refer to a factory method, like DateFormat.getInstance() ?
A factory is an object that exists for the creation of other objects. An example is the ThreadFactory class in java.util.concurrent. A factory method is a method that's responsible for returning instances of a particular type, usually the same type that contains the factory method. I rarely use factory methods, except for types that by nature have a limited amount of distinct instances (value objects). This enables you to force this limitation, and possibly even add caching. I've never designed a factory myself, only utility classes that contain a bunch of factory methods. An example: My Sudokus class that had createSudoku(), createXSudoku(), createSamuraiSudoku() methods, etc.
"Design and create objects using a factory" sounds like a very silly thing to preach as a hard and fast rule. It really depends on the situation.
The mind is a strange and wonderful thing. I'm not sure that it will ever be able to figure itself out, everything else, maybe. From the atom to the universe, everything, except itself.