Tag Info

Hot answers tagged

5

You wouldn't use it. It's mainly out there as an exercise to help you understand the interesting properties of java enums, for which there are a few uses beyond the more traditional C++ style uses. It's less verbose and requires some relatively deep knowledge of the language, which makes it attractive to the "look how clever I am" breed of programmers. ...


4

The Context Object is a pattern used in a number of places, including J2EE, ASP.NET MVC and Entity Framework. It is used "to encapsulate state in a protocol-independent way to be shared throughout your application." Context Object is a controversial pattern. Although it can be thought of as a means of Inversion of Control or Dependency Injection, it's ...


2

Your problem has striking parallels to functional programming: Monads, Functors, and composing functions. Your composability requirements essentially states that each operation must be a function that takes a stream and returns a stream: operation : Stream -> Stream Most functions will not be expressed in terms of whole streams but rather single frames ...


2

Labeling a pattern as [X] in Javadoc is really not so useful. Too many patterns are mis-applied because developers don't validate the patterns' assumptions (which are also not documented). Your Singleton example is trivial, as Singleton is more of an idiom than a design pattern. There's at least one project (http://www.jpatterns.org/) that uses Javadoc ...


1

By storing state inside a static nested class, you are limiting yourself to only being able to instantiate a single instance of this object. If you ever need to use multiple DAO implementations, or add another dependency that needs to change, this could cause a problem. Such requirements seem to me to be quite likely in order to sufficiently unit test this ...



Only top voted, non community-wiki answers of a minimum length are eligible