jump to navigation

Certificates, keystores and all that jazz September 28, 2016

Posted by javafoo in Uncategorized.
add a comment

What is it with certificates and developers? Most developers I have interviewed always try to glaze over it or try to brush it off saying, oh someone sets it up for us. I can’t believe someone has worked with webservices or for that matter even a simple http client in java without encountering trust issues with self signed certs or knowing how to get a certificate from a browser and installing the cert chain into a key store. Most webservices will use self signed ssl certs for lower environments like dev, sandbox etc. Another thing is using a private key to connect to an end point that does mutual ssl. I have had to show how you can import a private key file into the browser and then hit a secure endpoint and people look at me like it’s some voodoo. Yes you can do it in the browser.

Webservice: Returning Polymorphic types in response and reference client implementation October 9, 2015

Posted by javafoo in java, webservice.
Tags: , ,
1 comment so far

First let me get this off my chest. You have this fabulous rest service that works flawlessly, sure everything works in SOAP UI. But do you have a reference client implementation, do you eat your own dog food.

Currently working with this other team that we need to integrate with. They have a rest service that has polymorphic types in the response and there is no type differentiator in the json string. We are running into all sorts of unmarshaling issues because of this. Switched out different JSONProviders (Jackson/Jettison), still no luck. Sure there are ways to get around it, custom adapters, deserialzers whatnot. But figuring out how to plug them in can be a pain with scant documentation and when you are doing 2 week sprints. We are a java shop and asked them if they have a reference client implementation in java, since they are too and they said no, but everything works in SOAP UI and for our 1 client that uses dot net.

Please don’t do this to your customers. Atleast have a reference client implementation and don’t do polymorphic types in responses, atleast not without type differentiators.

Xml tags and elements August 25, 2014

Posted by javafoo in Uncategorized.
add a comment

Why do people get confused between tags and elements? When you are a developer, you are mostly talking about elements/nodes in the DOM tree or some type in the xsd. You should never be talking about tags. Even web developers don’t talk about tags, as most of it has been abstracted to some JS library. Unless you are handcrafting xml in notepad or something and are talking about missing a closing tag or something, I won’t judge you. But being a developer referring to elements as tags, now that is frown worthy.

Hate developers who will not look at the stacktrace April 2, 2014

Posted by javafoo in Uncategorized.
Tags:
add a comment

If you are a developer, please look at the stacktrace. Just don’t say it is failing, you are not QA. You are paid to figure it out. Look at logs, debug, add sysout statements whatever. Just get er done.

Difference between joins in sql January 31, 2014

Posted by javafoo in Uncategorized.
add a comment

Have been on the other side of the fence lately, doing interviews. One of my peer developer on the team asked the potential interviewee, the difference between inner joins and outer joins. That had me thinking, since as a Java developer, if someone had asked me that outright, I wouldn’t have been able to give them a direct answer. But I would have ventured some explanation related to set theory about intersections and unions etc. And if I were actually writing a query I can get it right for the most part. So posting this really great visual explanation from codeproject. Diagram is from their site as well. Now what did the interviewee answer, well something like: I will try to recall, it’s been a while since I worked with Oracle database. I don’t think we will be hiring this person, not because they haven’t worked with Oracle database, but since they think this concept only applies to Oracle.

http://www.codeproject.com/Articles/33052/Visual-Representation-of-SQL-Joins

Visual_SQL_JOINS_orig

More things to read up on April 10, 2013

Posted by javafoo in Uncategorized.
add a comment

Java nio – haven’t really looked at it and got asked about it

JMS – Different guarantee mechanisms. Use transacted true or CLIENT_ACK or AUTO_ACK or DUP_ACK. Durable queue.

Big O for collections April 8, 2013

Posted by javafoo in java, java interview.
2 comments

Yes, if you claim 10+ years of java experience and fumble/fudge on Big O complexity for collections, you are out. So please understand/read up on that. Happened to me, could get all the design patterns, OOPs, architecture level questions right, but fumbled on big O and the interviewer was like mmm…ok then, I don’t have any more questions, see you. I so want to jump in a well, even I wouldn’t hire myself. No, a map does not have O(n) complexity, it has closer to O(1) complexity or more if there are collisions. See here:

http://www.leepoint.net/notes-java/algorithms/big-oh/bigoh.html

Object Oriented Design Principles March 15, 2013

Posted by javafoo in Uncategorized.
add a comment

I am back in the saddle again. Here is a good resource on OO design principles, to brush up.

http://www.oodesign.com/design-principles.html

Content-Location and Location response headers November 9, 2011

Posted by javafoo in java http, javanotes.
2 comments

I thought I knew this at some point when I was doing this. But today, it had me searching again.

So just putting this here for my understanding. You would find the Content-Location header in your response, when there are alternative locations for the resource.

For ex: you visited http://www.somesite.com/home and the actual location of the resource is at http://www.somesite.com/home/default.html. Then your response would contain this header, ‘Content-Location: http://www.somesite.com/home/default.html’. Usually the response code would be 200 in this case.

You find the ‘Location’ header in your response when you are being redirected. Usually the response code would be one of 3xx in this case. So the client can redirect to the new location.

JSP as integration testing glue July 25, 2008

Posted by javafoo in j2ee, java, java http, javanotes.
1 comment so far

As part of one of our new projects, a team mate and I are working on two different areas of the project. This other team mate is responsible for writing the integration glue code that uses all the components that I am writing. But he is not ready yet and I will be on vacation when he is ready. Of course I have unit tests to test my parts. But I want to test the integration part of it. I can do this the boring way: write a Junit that sets up all the test data and almost end up writing very complex tests to integrate all my components. The more fun way is to write JSPs to do all the integration tests, the JSP can act as a loose test glue script. And I am building the JSPs in such a way that I can stop and view the results at each integration point, before moving on to the next one. It’s visual and fun. And I have managed to catch quite some bugs. I wonder why I haven’t thought of looking at JSPs this way.