Random Lost Thoughts

Bring out yer dead!

At various points throughout the show, there have been numerous dead bodies and with it, a strong urge to bury the dead. Consider even when Rousseau and Karl were shot by Mercenaries, they took the time to bury the bodies, and it’s not like their arrival was going to be a secret for long. in LaFleur, when Sawyer and Juliet killed the others attacking Amy, they had to bury the bodies in accordance with The Truce. Now this might be a way to hide the killings, but it also may mean that any dead bodies must be buried. After The Purge, the bodies were put in a shallow grave, but not covered.
Read the rest of this entry »

Tags: ,

Using Composition in Object Modeling

Using composition over inheritance is a common design pattern that is often discussed in terms of designing business logic components. However, composition can solve a number of problems in domain object modeling that are created by relying on inheritance to share interface or functionality. Composition is used to delegate implementation in logical units by enlisting the help of a reference to an object that implements the required functionality instead of inheriting from it. This reference can be changed to different implementations depending on the needs at the time making for a more flexible design. This same design can be used in domain modeling to overcome some of the problems caused by inheritance. The typical flawed example of using inheritance in object modeling is the Person class which is often subclassed into Employee, User , Customer and Vendor classes.
Read the rest of this entry »

Tags: , , ,

Weld 1.0.1-CR2 is available

Dan Allen posted that the latest CR version of Weld is available. This should contain a number of bug fixes from the initial release of Weld, including the two problems I had with the request scope being available in EJB timeouts and problems with the ability to proxy stateless beans. This last bug was for me rather crucial since there was no easy way to implement DAO (just data management) type components with transactional annotations that could be injected into business logic beans. Without that, you end up having to write your own transaction handling code.

Also in the comments of the announcement, Max Anderson notes that the nightly builds of JBoss Tools 3.1 now supports CDI auto completion and JSF 2.0. I had a very quick look at it yesterday and it looks promising. I also tried it out with the latest JBoss 6 snapshot and am very pleased to say that the redeployment times on JBoss 6 are much faster and more in line with the performance on Glassfish which is something I have raved about.

I’ll be looking at it some more and probably write up a couple of tutorial posts.

Tags: , , ,

LA X / What Kate Does

By now, the repetitions that we have seen across several seasons are coming thick and fast, another Lostie faces a ‘test’ and fails, Kate almost ends up delivering Claires baby, Sayid is strapped to a bed and electrocuted and tortured and we have another woman who comes to the Island pregnant, delivers a baby which is stolen and then she goes a delightful mix of crazy feral. When Kate tells Sawyer she never should have come after him, Sawyer asks “Which time?”. Even the characters are pointing out the repetition.
Read the rest of this entry »

Tags: ,

(One of the) Best Burgers Ever

Believe it or not, but I find Applebees burgers to be the best burgers I have ever tasted! This may be heresy coming from a self confessed foodie, but hear me out. Usually, I find burgers from chains fairly throw away affairs, you get it, eat it, it’s hot, it probably has some nice toppings, and you’re done. However, I don’t know whether it is the new line of “Real Burgers” they started doing months ago or if they just started making them better, but their recent burgers, particularly the A1 Steakhouse burger is just fantastic.

It comes on a lightly toasted bun, on which they put a drop of tangy A1 sauce and a creamy mayonnaise type dressing and plenty of fried onion straws. Now, if they’ve done it properly the burger should have some pink to it but still be warm throughout and that is when you get a good juiciness to the burger. They’ve been a little bit inconsistent recently and not asked how I want the burger and sometimes I get it well done and other times I get it nice and pink-ish. Since they can’t decide on a default, just tell them you want it pink and warm throughout (medium as opposed to medium well).

When this thing arrives, you start by biting into the soft bun and then you plough through the onion straws which have a mildly crunchy fried texture and a slight sweetness from the onions. You then hit the soft mild (swiss?) cheese and the burger which is a patty of tender juicy beefiness with just the right crumbly texture to the burger and a juiciness that drips. In there somewhere is the tangyness of A1 which punctuates the other flavors now and again. These things are awesome and they are on the 2 for $20 menu (2 meals plus an appetizer for $20). I think they are grinding their meat fresh, and gently forming the patty so the meat doesn’t form into a tight beef puck which just gets tough.

Next time I plan on broadening my horizons and trying one of their other burgers (cowboy or cheese burger) to see if it is as good. The A1 burger doesn’t have bacon on it which normally should be an instant penalization, but regardless this burger is still so tasty. I used to have the cowboy burger (well done) but the toppings (onion rings, bacon and BBQ sauce) were tastier than the burger. I plan on trying it with the new improved burgers since perfect burger plus fantastic toppings could lead to an epic event!

(Update – 8th Feb 2010 – After taking my brother and Sister in law there, we found that a) They are thoroughly inconsistent, with the better burgers being the exception not the rule. b) Their service was crappy as they delivered appetizers, salad and the burgers in the space of 2 minutes after letting us wait for 10 minutes (Their problem, we planned on having a long meal and working our way through the cocktail menu). Also, they just got usurped by Michael Symon).

Tags: ,

Getting Started with JSF 2.0 and CDI part 3 – Events

Last time we looked more in depth at CDI and how we can define beans and inject them into other beans. This time we are going to look at how we can use events to decouple the handling of actions in the system.
Read the rest of this entry »

Tags: , , , , ,

Understanding Nested Conversations

I had a bit of epiphany on the subject of nested conversations the other day when I was thinking about them and thought I’d share. I think nested conversations have been a little misunderstood with people unsure of how to use them, myself included, but I think I have found the best way to think of them.

In summary, nested conversations do for regular conversations what conversations do for session scope. With session scope, you cannot have mutliple instances of a named variable, you have to put each variable instance in its own conversation where it will be unique. However, if you want to have multiple instances of a named variable within the conversation, again, you cannot and you have the same problem you have with the session scope, that variables must be unique. Therefore you have to have each variable in its own nested conversation under the main conversation the same way we had the top level conversation under the session scope.

In some weird web app which lets you pick a person and then put costumes on them, you might have a main page where you select the person, and then in separate browser windows you can pick different outfits for that person. You put the selected person value in a different conversation so the value of #{selectedPerson} is local to the conversation allowing multiple selected people in different browser windows. This overcomes the limitations of the session which allows only one value for #{selectedPerson}

However, if you had that conversation open in multiple windows or tabs so you can compare different costumes on that person, there would only be one value of #{selectedCostume} for the conversation shared between all windows. As you select a costume in one window, it would affect all the other windows as they share the variable in that conversation. Using nested conversations would allow the conversation to have different values for the selected costume under the same parent conversation with the same selected person.

Taking it further you could select the person in the top level conversation, select the costume in the nested conversation, and then you could have multiple windows open with further nested conversation letting you pick different shoes to go with that costume. Also, if you change the person in the top level conversation, it will change the selected person for all windows using that conversation or any of its nested conversations.

I’m not sure there is a great need for nested conversations, I’ve never really used them or found the need and I don’t think users open that many browser windows or tabs to create different logic paths within a conversation. I think it is acceptable to limit the data isolation to a single conversation level.

Tags: , ,

Christmas Hiatus Over

Well, 2009 is done with and we are plunging headlong into 2010. Being European, I like to take a good week off around Christmas and New Year and with relatives here for Christmas I haven’t spent much time on work or blogging. So for those that have sent emails, apologies for the delay and I’ll get back to you this week/weekend. I have a few posts lined up including part 3 of the CDI articles covering Events, I’ll probably do one introducing conversations and then I’ll start writing on creating some real world apps with JSF and CDI. If anyone has anything they’d like to see in these articles, let me know.

Also, I have a couple of food posts almost completed as Christmas was full of good food and recipes that inspired me to blog about it (Must have been watching Julie & Julia in the New Year that did it).

Happy New Year all!

Tags: , ,

Getting Started with CDI part 2 – Injection

In part 1, we looked at creating a JEE 6 application with Netbeans using JSF and CDI running on Glassfish. Now we’ll take a closer look at using CDI for managing dependencies in a Java EE 6 environment.
Read the rest of this entry »

Tags: , , , , , , ,

Getting Started with JSF 2.0 and CDI in JEE 6 part 1

Here's a quick tutorial on how easy it is to get started with JSF 2.0 and JSR 299, Java Contexts and Dependency Inject (CDI) using the latest release of Netbeans 6.8.
Read the rest of this entry »

Tags: , , , , ,