Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!

Roy Pozarelli

Ranch Hand
+ Follow
since Oct 17, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Roy Pozarelli

Is the RunnableFuture and the RunnableScheduledFuture nothing more than work-arounds (support backward compatibility) for the Callable. By that I mean if you call an executorService.execute(runnableFuture), the execute returns void, however the runnableFuture has set in it any returns from the running of it. So is this the idea behind this?
3 years ago
I was just curious about the following:
java.io.FileFilter:



Why was this named accept? It seems to me that it should be named like a Predicate (ie. method named "test") since it returns a boolean, as opposed to a Consumer that uses the name "accept" but returns void. I thought this might be a historical thing since java.io was around from early on, but @FunctionalInterface is recent so it seems to me that this is not the case.

Your thoughts?
4 years ago
page 65


Should the DOES NOT COMPILE line be:
Bird bird = (Bird) fish;

Since the point of the example is to show 2 unrelated classes can't be cast to each other.
As written, of course the code won't compile but not for the reason listed.
My bad, I read your reply badly, you are right.
The issue, as I see it, is that there are 2 enum constants ONCE & TWICE, but they are not both instantiated at the time of the first one.
In Jeanne & Scotts book OCP Java SE8 Prog..II page 23. "The first time that we ask for any of the enum values, Java constructs all of the enum values. After that, Java just returns the already-constructed enum values." The following code doesn't seem to bear this out. What am I missing?

Thanks, my bad, copied one too many lines.
4 years ago
I have a question about the code below. Why is added.toString() showing Optional[false] when the result of this is adding to the results set? I didn't expect this value. In reading the documentation for Optional's map()
"If a value is present, apply the provided mapping function to it, and if the result is non-null, return an Optional describing the result. Otherwise return an empty Optional." and the return value of the add on a Set is boolean of true if this set did not already contain the specified element.

I was expecting the output to show
added : Optional[true]



added : Optional[false]
results.isEmpty : false

So what am I missing?
4 years ago
Jeanne thanks for your reply. I'm aware of documenting assumptions. Could you address the real issue that I was trying to bring up. That being the issue of having a "more clear diagram" vs. "real world" issues. I can see being "knocked" on either side of that debate (this won't work in the real world vs. the diagram is not clear). Could you please speak to that side of the issue that I first posed? TIA.
I'm considering showing 2 "<<device>> Firewalls" in my Deployment Diagram to represent what is "inside" the DMZ. Ex. Outer firewall -> Web Servers -> Inner Firewall -> Application Servers -> ... as opposed to a single firewall and just labeling the Web Servers as inside the DMZ. It clearly makes it more obvious with the first approach. However, it seems to me that you can set-up a DMZ with a single Router/Firewall in the "real world". I understand that this is just an assignment for the OCMJEA Part 2, so I would argue for clarity, however it should reflect reality (the whole point of a diagram). There is also a cost issue that doesn't seem to come up in the requirements, but does in the real world.

Your thoughts about how to depict this?
I had sent this question to Oracle after posting it here. Below is the reply that I received.

Please note we have checked with our exam development team on this and they have confirmed as below:
"Yes. The candidate's submission can have JavaScript in it. He can send UML diagrams embedded in webpages developed by using HTML without or with JavaScript. He has to ensure that the JavaScripts files are properly bundled in the submitted JAR file and the UML diagrams are visible, legible, and navigable."
I'm working on the OCMJEA - Assignment (Part 2). I'm using SPARX Enterprise Architect for my UML models, and it has the ability to generate HTML that includes JavaScript. In the assignment that I have, it says nothing about JavaScript. So in my submission, can I include JavaScript or not?
In prepping for the certification I have the following question:
in javax.xml.rpc.handler.Handler you have handleRequest(MessageContext context) and handleResponse(MessageContext context)
in javax.xml.ws.handler.Handler<C extends MessageContext> you have handleMessage(C context)

Now it seems to me that you have to use the MessageContext field MESSAGE_OUTBOUND_PROPERTY to make the distinction between in/out bound message direction vs. the "rpc" handler that had the container making that distinction, i.e. the logic was moved from the container to the implementor of the handler.

WHY was this done?

Is there another idea here in that the purpose of the handler should not care about direction? i.e. it should be performing the same behavior irrespective of the direction of the message?
I'm just now learning WS-Addressing, and in reading through the spec for the Meta-Data, I don't understand the difference between the 2 in the subject line MEPs. Can someone enlighten me? or point me in the right direction (books/articles/sites) that would explain why the need for the 2 and what is the difference.
7 years ago
In reading the JAXB2.2 spec. p. 152 (10 Dec. 2009) sec. 6.13.1 "Distinguish between generated and user added code". What I can't seem to find is the ability to NOT clobber user added code if I regenerate from a *.xsd file. Is this possible?
7 years ago