- Neither MonogDB'sMongoDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation, apart from the missing method descriptions, is questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MonogDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation, apart from the missing method descriptions, is questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MongoDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation, apart from the missing method descriptions, is questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MonogDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation is, apart from the missing method descriptions, is questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MonogDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation is, apart from the missing method descriptions, questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MonogDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation, apart from the missing method descriptions, is questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between
- Neither MonogDB's
BasicDBObjectBuilder
nor yourUserDocumentBuilder
is a Builder according to the pattern of the GoF.
Your name
UserDocumentBuilder
is somehow confusing. Especially when you then define:BasicDBObjectBuilder userDocumentBuilder = new BasicDBObjectBuilder()
It represents a builder for a user, not a builder for a document of a user, doesn't it? Hence, I'd rather call it
UserDBObjectBuilder
.AFAICS the only added value to
BasicDBObjectBuilder
is theaddDetails(...)
method to add keys/values from aMap
rather than single key/value pairs only.Why don't you simply:
public UserDBObjectBuilder extends BasicDBObjectBuilder
and just overload
add(...)
withadd(Map details)
therein?You supply a
passwordHash
to:public UserDocumentBuilder(..., String passwordHash, ...)
and you apply another hash algorithm to this already-hash then? Why?
MongoDB's
BasicDBObjectBuilder
implementation is, apart from the missing method descriptions, questionable on its own:- What is the difference between
add(...)
andappend(...)
? - What does
push(String key)
do? Adding akey
with anull
value associated to it? - What if I invoke
BasicDBObjectBuilder.start("key", "value").start()
? Is the building process started over again by eliminating the values given at the firststart(...)
? → Thesestart()
methods should better be different constructors.
- What is the difference between