blogging from reza rahman’s jee 7 talk

This month’s NY JavaSig was chock full of information about JEE 7.  It was nice seeing it before Oracle’s launch webcast.  And at a more convenient time as well!  Given that Reza Rahman works for Oracle, we got the standard Oracle disclaimer that anything can change in the next two weeks.  But we all know they don’t have time to change much so 99.9% of this should be true.  [comments in brackets are my opinions; not Reza’s or Oracle’s]
High level JEE 7 changes
  • JMS 2. Batch. Transactions. Concurrency, interceptor, web socket java api, json java api
  • El 3, jms 2′ jax-rs 2.
  • Rest like EJB are minor releases. Ejb 3.2 (interestingly CMP is from J2EE 1.3)
  • Add to web profile: jax-rs 2
  • Deprecate jax rpc, cmp, cmp, jsr 88 – no known tools to get off bmp/cmp
  • Themes are productivity and html 5, core foundational apis
Jms 2
  • 8 year old api. Needed an overhall
  • Change api to use  DI
  • Delivery delay, async send, delivery count, now standard rather than optional, mdb alignment
  • Now you just inject JMSContext and Queue – a  new Object. Reduces code from a slide to a few lines.
  • Uses default JMSContext connection factory unless specify otherwise
  • Context has createProducer() and createConsumer(). Uses builder pattern so can chain/use one liners to configure
  • New API uses runtime exceptions
  • Added JMSConnectionFactoryDefinition and JMSDestinationDefinition annotations so can configure in code instead of vendor specific descriptor. Can still use xml instead of annotations
  • MDBs have new @ActivationConfigProperty
  • Spring will be supporting JMS 2 in their apis. Will need new JMS apis as well from third party libraries.
Websockets
  • Stateful protocol. Bidirectional async communication. Good for gaming, online stock tickers, etc
  • Uses HTTO as handshake between client and server
  • Part of HTML 5. Hope people will be using within 3-5 years.
  • Very high level API
  • Supports both declarative and progamatic programming. Most people should be dealiling with declarative api.  The programmatic one is meant for third party api developers
  • Abstracts keep alive setting
  • Weakness in websocket spec: can use up all sockets on a machine
  • Keep alive packets sent about every 5 minutes (vs 30 seconds normally). If your router times out after a minute, you’ll need to reconfigure. No session replication yet. If server goes down, you lose it
  • Server side code – POJO with annotaton for serverendpoint(url)’ onopen and onclose. Onopen and onclose callbacks get passed a session. Also callbacks for onmessage and onerror.  Use session.getRemote.  To get handle to remote endpoint and call sendXXX. It is NOT an HttpSession  because you are not in http level of abstraction
  • Client – JavaScript has an api for websocket.  Use this 90 peercent of the time
Json
[feels like java util logging.  late to the party and not as good as open source libraries]
  • Have jsonp – Like xmlp?
  • Will have jsonb in future –  Like xmlb. Eclipselink has two implementations now. Moxi and eclipse link json binding. The later one is likely to be closest to the standard.
  • No safe bet. Use what exists now and change later
To use
  • JsonArray  array = Json.createArrayBuilder(). Can add primatives and objects
  • To read: parser().iterator and parser,getString()
  • iterator,nextO will return START_OBJECT, KEY_NA ME, etc in addition to the real values.  [ugly – reminds me of the early days of DOM]
JAX-RS 2
[Lost what i typed because after deleting text undo deleted still more text. I think i remembered it all to retype]
  • Jersey is an implementation as is RESTEasy
  • Jax-rs was was introduced in jee 6
  • Hypermedia support – using hyperlinks in rest, like for lazy loading
  • Cient api, message filter, entity interceptor, asnc processing for high throughput, content negotiation (queues used to apply weight to client)
  • Client api: ClientBuilder.newClient() and client.target(url, params, …  )
  • For filter implement ContainerRequestFilter
JPA 2.1
  • Schema generation – every provider supports already.  This adds a standard format. Can create database and/or ddl,   Showed examole with index names in Java and said “no other way to do it” [yuck – this is why you should separate your DDL and not store it in only in Java.  You are going to need that standalone DDL later anyway for laters so why not put the index there.]
  • Stored procedure support – people want it, all providers have it already so gave in and put it in in ORM spec.  Looks like namedqueries. @NamedStoredProcedureQuery
  • Unsynchronized persistence contexts – can join when  ready to rejoin context
  • Entity convertors – edge case solution for odd format in database field but dont want in java objects
  • Fixes/enhancement
Jta 1.2
  • Old api that needed an update. Lots of fixes and two new features
  • Declarative transactions outside EJB – any CDI object supported now. @Transactional. Default is rollback for runtime exception and ignore checked exception
  • @TransactionScoped – new CDI scope. JMSContext uses this scope
Jsf 2.2
  • Html 5 support – pass thru html 5 components. Use normal inout type=color and then jsf:value and el expression as attribute. That way not limited to jsf component libraries. Similary jsf:id, jsf:validate, jsf:renderer
  • @Flowscoped – alternative to conversation scope. Conversation was suited to wizards. Flow scoped keeps certain objects active for different parts of the app. [Code looks like a state diagram in java code – long]
  • @ViewScoped for CDI
  • Deprecated JSF managed beans. Use CDI instead
  • File upload component – couldn’t add until now because JSF was being backward compatible with 2 versions of servlet apis
  • View actions – can trigger an action when land on page rather than wait for user to click on something
  • Multi templating – templates can have parents
  • Security
Batch applications
  • Concepts. JobRepository, Job,JobOperator, Step, ItemReader, ItemProcessor, ItemWriter ( map reduce pattern with readerprocess, write)
  • The java community doesnt generally get into batch processing. Financial community is different. Hadoop and analytics starting to bring batch to wider audience
  • To code use named annotation and implement Itemreader, ItemProcessor, ItemWriter
  • Write XML for step to chunk it and send to reader, processor and writer. Methods. ReadItem, processItems, writeitems
  • IBM websphere compute grid  called out for batch multi threading on different machines.
  • IBM most active and spring second most active contributor to batch spec. Presumably that means Spring is interesting in supporting
Bean validation 1.1
  • Added method level constraints.  Useful in REST. Method param and return type constraints.  Used to only have property level
  • Bean validation artifacts injectable
Concurrency utilities for JEE
  • Builds on JSE Executor Service
  • Thread pool aware
  • Relatively low level API
  • Don’t expect a lot of people to use.  Meant for third parties running on JEE so can share app server thread pool
  • Inject ManagedExecutorService annotation. Submit your task to executor
El. 3
  • Lambda expressions, collections support, operator support
  • EJB 3.2 truncating BMP/CMP
  • Servlet api – non blocking IO
  • Ordering of interceptors
Jee 8 
  • jsonB. – probably before JEE 8
  • Jcache – available as drop in jar before. Just missed JEE 7 cutoff
  • Lots more stuff
Tomcat
  • Base Tomcat planning on supporting JSR 356 (web sockets), maybe concurrency utilities
  • TomEE – apache project taking plain tomcat and brining up to JEE web profile level. It is certified against web profile

jeanne togaf certification part 2

I passed part 2 with 90% today.  Despite having taken part 1 a month ago and not touched studied since, I retained a lot. This is good. As I skimmed/read the part 2 study guide, I also realized I retained a lot from class.  I spent less than a week studying for part 2.  But most of the learning went on during the class and when studying for part 1.

Registering for the test

Registering at Prometric went smoothly.  I wish they’d let you search by zip code.  New York State is large.  My local testing site didn’t have any seats the day I wanted to take the exam.  And I would never go back to the second closest one (read why Horizon Technical Consultants of Flushing is no good.)  I then looked for centers in Manhattan and found NetComLearning.  (I think I might have taken the Core Spring cert there.  It’s a good center.  They even let you keep your wallet/house keys with you in your pocket.)

Resources I used to study

I’m sharing my scores in addition to commentary on the practice exams.  This helps with the “am I ready to take the exam” question.  The gist is that your score on your first attempt of the official practice test is a good predictor of your score on the real test.

Resource Comments
The official part 2 study guide. Since part 2 is open book, my study approach was to have both the official part 2 study guide and 700 page pdf open.  I mapped the text/paragraphs between the two as I skimmed/read.  The goal was to become familiar with how to find information quickly in the 700 page book.  Which is a useful skill for when I later need this information to apply TOGAF.While much of the text is the same as the 700 page book, it is easier to read and more concise.  It costs $30 but we were provided a copy as part of the course.  It also contains the official practice test, but more on that later.
Open Arch practice test – #1 I got 75% on this one.  I had only read a couple chapters of the study guide at this point.  I used a mix of memory and the 700 page pdf.  Note that this practice test is better than practice test #2.  I wish I had waited to try it.  It’s still not as hard/interesting as the official practice test though.
Open Arch practice test – #2 I got 100% on this one.  On this one, I looked up every single answer and used it as a sanity check that I could find information in the PDF quickly.  Which I could as I answered all 8 questions in 35 minutes.  Both practice tests seemed way too easy as they were a very straightforward mapping to the PDF.  It was also possible to identify some answers as wrong by comparing the verbiage in questions to each other.  The official practice test is much harder/more interesting.  They were still worth doing though.  If you can’t recall or look up this information very quickly, you aren’t ready for the official practice test.
9 multiple questions on viewpoints Viewpoints aren’t covered in the study guide, but are apparently important.  I went through the 9 multiple questions with the study guide open as a review from class.  I only got 5/9.  Wish there was some detail with the answers.
Official practice test This is included in the study guide.  Alternatively, you can buy it for 99 cents.  The reason I keep saying hard/interesting, is that they don’t give away the phase by stating it; you get to think.  That’s the interesting part.  The hard part is that the questions are LONG and there is a lot to keep track of when comparing answer choices.I like that the answer key tells you what they were testing along with a chapter/section reference in the book. My score was 95%.  I got the second best answer on the viewpoints question.   I’m shocked that I did this well as my brain felt like it was turning to mush while reading the choices. Other interesting scoring statistics: I identified the distractor correctly on 7-8 of the questions.  (on question 7, I wrote two choices as being distractors because I couldn’t tell which was the distractor and which was merely wrong.)  On 5 of the questions, I identified the 1st/2nd/3rd/distractor order completely correct.I spent 50 minutes on it.  I didn’t spend the remaining 40 because I read the 700 page book in the exam is hard to use.  Which means I’d waste a lot of time on that on the real exam.
My instructor’s 4 practice questions I got 40% on this.  I found the distractor on three of the four questions.  I wasn’t able to use the book to help me with any of this question set.  And I only spent 15 minutes.  Maybe I was tired? The spirit felt very different in that I used the book a lot for the official practice test and not at all for these four questions.  I did it again the morning of test day and got 80%.  Granted this was because I knew not to go with my gut choices.  I also used the book a tiny bit (to double check artifact names in one question.)  This was meant to be a confidence building activity and not a test of how I was doing.  I still find these questions to be A LOT harder than the official practice test.
Chris Eaton’s 2 practice questions I got 50% of this.  I found the distractor on one of the two questions.  I was able to use the book to help.  On this one, I KNOW I was tired as I missed the phase one question was asking about and it was explicitly stated in the question.

Tips

  • As you do practice questions, try to rank them in terms of “best answer”, “2nd answer”, “3rd answer” and “distractor.”  All the practice exams give you all four of these in the answer key so you can check your understanding AND test taking skills extra.
  • On both practice tests and the real exam, try to identify the distractor before you start ranking the others.  The distractor may not use TOGAF words.  Or it may pertain to a different part of TOGAF.  If you can identify the distractor on every question, your expected value is now 60% on the exam.  (Because you can now get 1, 3 or 5 points out of 5).  Conveniently, this is the pass score.
  • Read the description of the Prometric PDF usability issues.  I didn’t have this problem as you’ll see below, but it is still good advice.
  • There are two possible approaches on using the PDF.  One is to take the whole test without it and then check answers at the end.  The other is the use the PDF for each question but timebox it.  I chose the later. I determined I wouldn’t spend more than 10 minutes per question on the first pass.  Then I’d use the extra time at the end on any I “ran out of time on.”  In the official practice test, that was just the viewpoint question.

Test day strategy

  • I made sure that the laminated board was two sided.  You are entitled two two boards (or a two sided one.)  When I went to Horizonthey only gave me a one sided one.  For that test, I wasn’t writing much so it didn’t matter.  For TOGAF, I used the two sides.
  • The engine:
    • Don’t bother taking the practice/training test.  I said yes to taking it thinking I’d get to see where the reference button was for the PDF.  And maybe the navigation.  Nope.  It was just the standard Prometric engine in the practice.  Which you’ve seen in part 1 so should be familiar with by now.
    • The screen displays two frames.  The left one is the scenario part.  The right one is the one-two sentence question and all the answers.  I didn’t have to scroll as much as I was worried about.
    • The bottom left corner as a “reference” button that launches the PDF.  It was a little laggy; taking 1-2 seconds each time to open the PDF.  The PDF displays in a new “window”, but not the type you can alt-tab to.  So a lot of clicking.  The PDF was fine though.  I had read it was clunky, but it wasn’t.  You could navigate using the table of contents or searching or scrolling.  Just like when I practiced.  The only odd thing is that I seem to have hit a shortcut to keep scrolling down at some point.  I clicked around and it stopped after 15 seconds of poking.
  • Before clicking the start button, I took a moment to write each question #, “a”, b”, “c”, “d”.  I was only able to fit three of them going down the page so I put the fourth on the right quarter of the page.  I did the same on the back so I was all set for the eight questions.
  • The actual test was the first time I didn’t feel my brain turning to mush from reading the questions.  I guess I FINALLY learned to discern what is important.
  • I went through the questions in three passes.
    1. The first pass (50 minutes) was for questions I could answer in less than 10 minutes each.  I did use the PDF for six of the eight questions on pass one because I felt I could do so efficiently. During this pass, I wrote down the area I felt the question was testing and whether I felt each choice was the distractor, 1st, 2nd or 3rd answer along with my thoughts on why.  This helped me avoid having to re-read the answers.  It also let me recover my thoughts when revisiting.  I also logged the amount of time I spent on each question (to keep me moving) and my confidence level of my answers on a scale from 1 to 10.  This let me know which ones to go back to.
    2. The second pass (15 minutes) was for doing a mini “research project” on the two areas I was less familiar with.  I could have answered each of these in less than 10 minutes.  I choose not to on pass 1 so I could figure out where my time would be well spent.  Obviously, the “research project” approach wouldn’t help if you weren’t familiar with the PDF.
    3. The third pass (2 minutes) was to click through each question and make sure the radio button for my first choice was still selected.

Overall impressions of the TOGAF cert

  • Studying for part 1 was tedious to me.  I hate memorizing.  It is necessary to know the terms/phases though so it was worth spending time on.  Just unpleasant.
  • Studying for part 2 was more interesting.  It became an exercise in how to use the book efficiently for me in addition to becoming more familiar with TOGAF.  This is a good skill.  And most of the questions are about understanding/application which is more fun.
  • And nothing to do with the cert, but I have used a little TOGAF at work since I took the class.  Which shows the use!

Good luck on your cert and feel free to ask questions in the CodeRanch TOGAF forum.

Note: As usual, don’t bother asking me to share materials.  Everything mentioned here is either free online (which you can get) or paid content (which I will not share.)

“out of scope”

Wow. I haven’t blogged in almost a month! Not technical, but I’m going to share a gripe on “out of scope” today. I’ve had two instances where I went to a “session” expecting to learn one thing and then when asking a question, learning the “speaker” considers it is out of scope. You’ll notice I didn’t use the word meeting, presentation or presenter in there once.

Meetings
At the NY SPIN, Ramvasan spoke about “Facilitating Meetings”. So far so good. However, he only considers meetings to be certain things. And a one hour training session isn’t one of them. Nor is a “mandatory” meeting. Nor is anything that isn’t a team meeting as near as I can tell.

Presentations
Yesterday, I went to the Toastmasters conference and attended a “session” called “Presentation Zen.” It was about how you are the presentation and not the slides. So far so good. However, he doesn’t consider a “session” where you have to deliver a lot of facts to be a presentation. He did give some ideas on what to do. But when pushed fell back to the definition.

Both of these feel a bit like a cop out to me. Surely an expert/presenter on a topic has an opinion on how to handle things that aren’t exactly what they set out to speak about.

What’s worse is this closes the mind of the audience. If you are going to draw a box around your material and dismiss what is outside the box, I want to find this out in the first five minutes of the presentation. Not when someone has something that sounds like a perfectly legitimate question.