[jboss-dev-forums] [Embedded JBoss Development] - Re: Embedded API Design Problems

richard.opalka@jboss.com do-not-reply at jboss.com
Thu Dec 3 11:37:37 EST 2009


"ALRubinger" wrote : 
  | Thanks for the feedback, Richard. We're at Alpha-level to encourage this kind of discussion.
  | 
Do you know golden rule: Design your API properly since beginning. Later there will be no will to rewrite it?

"ALRubinger" wrote : 
  | I'm not strictly following bean conventions.  For the method chaining signatures, I considered Fowler's note on command query separation as detailed in http://martinfowler.com/dslwip/MethodChaining.html.
  | 
Thanks, I will have a look. Maybe I'll change my mind ;)

"ALRubinger" wrote : 
  | I'm a big fan of declared unchecked exceptions; they more completely document the API.
  | 
If you mean declaring it using @throws clause, I'm fine with you otherwise let me disagree.
See RULE 41 from Effective Java that says:
In case programmer that is using your API cannot handle thrown exception,
it's more proper to declare it as unchecked exception.

"ALRubinger" wrote : 
  | I don't care if the exception thrown is in a different package (eg Rule 2.2 "FileOutputStream.write(byte[]) throws ArrayIndexOutOfBoundsException").  Rule 2.3, consistency, is a design goal and any places that do not follow this need to be ironed out; which did you mean in particular? 
  | 
See RULE 43 (Exception translation) from Effective Java.

"ALRubinger" wrote : 
  | In order to act upon rule 2.4, forcing the user to deal w/ checked exceptions, I'll need some examples you believe need attention.  I don't agree with Rule 2.5.
  | 
What about RULE 40 from Effective Java ;)
(Regarding examples that need your attention, I provided one. Do you think it's not relevant one?)

"ALRubinger" wrote : 
  | From where are you deriving these rules BTW?
  | 
>From the same source like you Effective Java (my notes)

"ALRubinger" wrote : 
  | I don't consider Java Platform exceptions to be unnecessarily low-level; in fact Bloch encourages their use in validating preconditions/postconditions (I'd make a reference here but don't have my book w/ me).  These are well-known APIs which programmers are likely to know already.  Why wrap these in some Embedded-specific API?  IllegalArgumentException and InstanciationException means exactly that.
  | 
This is again RULE 43 (Exception translation) from Effective Java.

"ALRubinger" wrote : 
  | I don't see how the generics issue you point out is an inconsistency.  Also "other inconsistencies" doesn't help find action items. :)
  | 
I provided you examples of two classes from two different packages implementing the same feature.
Still can't see it? ;)

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4268834#4268834

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4268834



More information about the jboss-dev-forums mailing list