Archive for December, 2007

Island’s Fish Grill - Indiatlantic, FL

Brian LeGros | December 29th, 2007 | food  

Every time I go get my hair cut, the lady who cuts my hair talks about how much she loves the Island’s Fish Grill out near the beach. She always goes for dinner and says the prices are high, but she suggested my wife and I try lunch since it’s a much better deal. Well, today we decided to give it a try since we haven’t tried a new place in a while.

Let me just start out by saying, eating at Island’s Fish Grill has been one of worst experiences I’ve had since moving to the Melbourne area. Not only are the prices extremely high, even for lunch, but the service was so terrible that my wife and I wondered if the waiter (the only one they had working) just didn’t like us. Let me explain.

We arrived about 30 minutes before lunch ended to the small restaurant and were seated amongst 3 other couples who already had their food. We put in our drink orders and looked at the menu; they have a small lunch menu totaling around 8 to 10 items. About 15 minutes later, we placed our lunch order. We only had an hour and a half to eat, so we decided to keep the order simple. We ordered the chicken Caesar wrap with fries ($10.50 which was the special) and the local snapper sandwich with the soup of the day, Manhattan clam chowder ($11.00), prepared with jerk seasoning (+$1.50). We also got water and a Sprite ($2.50). We waited for 40 minutes to get our food during which about 4 more couples came into the restaurant, had their drinks filled, re-filled, and even got their food. When our food finally did come, we washed it down by chewing on the ice in our glasses because we didn’t get to talk to our waiter again until we got our check. I could have sworn my sandwich was supposed to be ~$2 less but by the time we were able to leave it wasn’t worth debating; also my usual patience was already worn far too thin.

I could go into my thoughts on the meals (I did like the fish) but I’m not going to give anyone reading this review any insight to the quality of their food; it’s the least this place deserves. The only thing I can say is unless you like waiting long amounts of time for food that comes with poor service and a ~$30 tab for a couple sandwiches, then Island’s Fish Grill is not for you. You pay to be eat on a road near the beach and for the potential to eat what the local fisherman provide. Bonefish Willy’s is a much better alternative with a great view, food that is just as fresh, and a bigger menu. Maybe one day when I’m really smug and realize I’m better than everyone else I’ll go back.

Island’s Fish Grill is located at 111 5th Avenue, Indialantic, FL 32903.

Uses for non-visual Flex components

Brian LeGros | December 13th, 2007 | programming  

Recently, I've been interested in examining the features of non-visual components as it applies to Flex. I don't hear them talked about a lot (at least in the small part of the blog-o-sphere that I read), but I think there are some uses for these types of components that could really catch on in the community. I've tried to put together a sample application to show an example of some of the ideas I'm playing with in my head.

So the big place where I see non-visual components having a use is when attempting to bridge the stateless and stateful portions of a Flex application, mainly in the area of remote services. When I design a web service or remote object to be used by Flex, I typically build it in Java (or ColdFusion) and I design the service such that its methods operate in a stateless fashion. For example, when I call a method on my service, I don't expect previous calls to that method to influence the results of my current call; at least from the perspective of the caller. Additionally, I have the expectation that more information may be required when calling the method since the remote object receiving the call has no context in which to interpret the method call besides the method itself. Now I'm know an argument can be made about whether something truly is stateless or not, but that's not the goal of this post. Let's work with this ad hoc definition of stateless for now.

Flex provides us with a very simple, global means to get a hold of these services: RemoteObject, WebService, HttpService; there are other means by which to connect to remote services, but for now let's take the simple example of stateless RPC-based services. Typically in my Flex applications, I want to emulate a synchronous call from the application to the service (using something that implements IResponder or mapping the result/fault methods manually). Ideally I should have a class abstracting these calls to improve cohesion in the application; frameworks like to use command, delegate, or proxy classes, for example. During the emulation of this synchronous call I usually have my result/fault handler call out to a method on a class to change the state of an object (e.g. - setting values on the ModelLocator in Cairngorm), consequently firing propertyChanged events and/or custom events to update visual components via data binding.

All that being said, there are a couple of things with this approach that I want to address. First, I'm making the assumption that the class which abstracts the interactions with my service should also remain stateless. No where in the creation of the object am I changing its state so that the behaviors associated with the object may have a different context when executed. Second, I'm making the assumption that the behavior of this abstracting class must be separate from the data it uses. Propagating a change in an object's state via events is the back-bone of Flex data-binding. Not only that, but data binding is very simple to use and code, why shouldn't this simplicity be available in the ActionScript class abstracting the call to the remote service?

So that's enough conceptualizing for now, let's look at some example code. Please note the entire working example can be found at this location.

In this example, we have a very simple phone directory application. A SearchView exists which takes input from the user and announces a custom event (SearchEvent) passing that user input as its payload (i.e. - SearchCriteria). This event is handled by the Application class which in turn calls the find() method on an instance of SearchComponent. SearchComponent is a non-visual component which uses data-binding to propagate changes from the stateless world into my stateful Flex application. The code for SearchComoponent can be found below:

  1. package com.brianlegros.nvc_example.component
  2. {
  3.    import flash.xml.XMLDocument;
  4.    import mx.collections.XMLListCollection;
  5.    import mx.collections.ListCollectionView;
  6.    import mx.collections.IList;
  7.    import mx.collections.ArrayCollection;
  8.    import flash.net.URLRequest;
  9.    import flash.net.URLLoader;
  10.    
  11.    import com.brianlegros.nvc_example.vo.Employee;
  12.    import com.brianlegros.nvc_example.vo.SearchCriteria;
  13.    
  14.    public class SearchComponent
  15.    {
  16.       [Bindable]
  17.       public var locations : IList;
  18.      
  19.       [Bindable]
  20.       public var departments : IList;
  21.      
  22.       [Bindable]
  23.       public var employees : IList;
  24.      
  25.       private var data : XML;
  26.      
  27.       public function SearchComponent() : void
  28.       {
  29.          var request : URLRequest = new URLRequest("results.xml");
  30.          var loader : URLLoader = new URLLoader(request);
  31.          loader.addEventListener(Event.COMPLETE, function() : void
  32.             {
  33.                data = XML(loader.data);
  34.                
  35.                locations = findLocations();
  36.      
  37.                departments = findDepartments();
  38.             }
  39.          );
  40.          
  41.          this.employees = new ArrayCollection();
  42.       }
  43.  
  44.       private function findLocations() : ArrayCollection
  45.       {
  46.          var temp : ArrayCollection = new ArrayCollection();
  47.                  
  48.          for each(var item : XML in this.data.employee.location)
  49.          {
  50.             if(!temp.contains(item.toString()))
  51.             {
  52.                temp.addItem(item.toString());
  53.             }
  54.          }
  55.          
  56.          return temp;
  57.       }
  58.      
  59.       private function findDepartments() : ArrayCollection
  60.       {
  61.          var temp : ArrayCollection = new ArrayCollection();
  62.                  
  63.          for each(var item : XML in this.data.employee.department)
  64.          {
  65.             if(!temp.contains(item.toString()))
  66.             {
  67.                temp.addItem(item.toString());
  68.             }
  69.          }
  70.          
  71.          return temp;
  72.       }
  73.      
  74.            
  75.       public function find(criteria : SearchCriteria) : void
  76.       {       
  77.          var temp : ArrayCollection = new ArrayCollection();
  78.                  
  79.          for each(var item : XML in this.data.employee)
  80.          {
  81.             if(criteria.firstName.toUpperCase() == item.firstName.toString().toUpperCase()
  82.             || criteria.lastName.toUpperCase() == item.lastName.toString().toUpperCase()
  83.             || criteria.nickName.toUpperCase() == item.nickName.toString().toUpperCase()
  84.             || criteria.location == item.location
  85.             || criteria.department == item.department)
  86.             {
  87.                var employee : Employee = new Employee();
  88.                employee.firstName = item.firstName.toString();
  89.                employee.lastName = item.lastName.toString();
  90.                employee.nickName = item.nickName.toString();
  91.                employee.location = item.location.toString();
  92.                employee.department = item.department.toString();
  93.                employee.phone = item.phone.toString();
  94.                
  95.                temp.addItem(employee);
  96.             }
  97.          }
  98.          
  99.          this.employees = temp;
  100.       }
  101.    }
  102. }

There a few things to note about this component for the purpose of this example:

  • A method on a remote service/object is not actually being called, I'm using an XML document to simulate that process.
  • I am not actually emulating a synchronous call, I'm allowing the current thread to block on the method call. If I were to emulate the synchronous call, I would suggest using anonymous functions as the result and fault handlers for the remote service/object. The code in this example would be short and not warrant a named method mapping (this is done a lot in JavaScript when registering event handlers).
  • Yes, my coding style kinda sucks, get over it.

Now when the find() method is called it does not return anything, instead it updates the component's internal state via the employees property which then fires a propertyChanged event which is handled by ResultsView to populate a datagrid. Additionally, notice that when the object is constructed it makes a call to fetch location and department information to which controls in the SearchView are bound and updated when construction is complete. These values from these controls are used to filter the search performed by the user.

Going back to the conceptual, there are a few questions that come to mind:

  1. Aren't components supposed to be reusable? - From my POV, it feels like Flex has already done a great job of handling re-use through the RemoteObject, HttpService, and WebService classes. It seems that if re-usability is needed it would be at the service rather than the non-visual component. The non-visual component in my example is literally acting as a perspective for its service, or what potentially could be a group of services. Right now, however, I'm not sure if there are huge performance issues that may result from having multiple component perspectives for a single or series of services. I would assume for RemoteObject it may not be as big as a hit as it would be for a web service. Maybe this would be based on the remoting implementation you choose (i.e. - LCDS, BlazeDS, WebORB, Granite Data Services, etc).
  2. Aren't you just causing side-effects on objects? - In my opinion, it's not doing anything different than what Flex is doing with its visual components. In fact, what I think justifies this particular approach is the fact that you have the ability to notify anyone watching the object when its state has changed; I've always considered side effects as changes in state that I potentially didn't know about as the caller. The Flash movie instance is stateful; why not take advantage of this environment to add state to the classes abstracting our services? I'm building these non-visual components to satisfy the needs of my application, so I will know how they should behave and can to document that formally based on the constructs of the language. Now, if you ask me if this approach should be used for building an API-like interface to a set of remote services, then I would have to say no. The implementer of an API doesn't know how their code will be used in the context of an application, consequently keeping these components as stateless as possible is to the benefit of the API developer; context is limited to the execution of a method call. I think the Twitter API for Flash Developers is a great example of this.
  3. Where do I put all of these non-visual components? - This question I believe involves much more conversation about the implementation of these non-visual components. The example application is extremely simple and does not represent the issue of how to handle event propagation. In the example, all events are being propagated to the Application class and emulating a sort of global event system similar to those that I've seen in Flex frameworks with which I've worked. In fact, this is how easyMVC handles its event registration in the ControllerFactory; a ControllerEvent with a user provided type is registered on the Application and no matter where the event is dispatched, it's told to bubble to the Application to be handled by a mapped method in a custom Controller class. I have to admit that I like this approach much better than Cairngorm and PureMVC's approach of building their own global event system. I know both camps have their own reasoning for why they've done it, but I don't think that what Adobe has provided is worth re-writing. On the other hand, does the hierarchical nature of MXML bind visual component layout and construction too close such that without global event systems we can't be productive as Flex developers? On a side note, data binding in practice isn't always the answer to our problems; how a component can take advantage of these non-visual components and still interact with the components it needs to is a mystery to me. This may come back to the nature of MXML as well.
  4. Do I need a framework if I use this approach? - This is something I'm still trying to figure out. The biggest use of Flex frameworks I've found is a structured approach for making calls to remote services. I feel like frameworks have way too much boiler plate code and if this approach is practical, a good alternative may exist in place of adopting a framework. It seems to me like Flex frameworks have come from the mindset of the web world where stateless HTTP is king. We don't have to use the Front Page Controller pattern to build rich UI's; I think it's time to move on to different interpretations of the MVC pattern. I always find myself asking, did developers in the Java Swing world find themselves turning to a framework or were the constructs of Swing enough to be productive. If people were productive with Swing and it was a widget toolkit for AWT, why can't the same be true for Flex and Flash?

All this being said, this is just my latest idea. As you can tell, I still have a lot of unanswered questions. We are the process of implementing this approach on a much larger scale at work and hoping to solve the questions listed above. I'm always interested in feedback, so please rip this to shreds. I am far from experienced in this arena and am always open to what others have to say despite what some may think.

NOTE: For those who are interested, I began along this line of thinking based of the latest buzz-worthy topics in the programming community. It interested me as to how OSGI implemented their component architecture in Java w/o some language level support (e.g. - formal properties) and why it so popular. I was also intrigued by a proposal put together by Joe Noxel, from the Java Posse, regarding additions to Java for some of the language level elements already present in Flex. Additionally, SOA has come into debate by some of the more experienced professionals in software engineering and SCA (see Apache Tuscany as an example) has been identified as a potentially better alternative. So all this talk, combined with the little amount of component programming I've done with COM+ and .NET, made me wonder. If there is such a huge draw towards component-oriented design is there anything in Flex that we can do to take advantage of these practices? Does having formal properties and support for events as it presents itself in Flex aid developers with the tools necessary to utilize component-oriented design? Is one of those areas specifically the perspective of bridging the gap from the stateful component to the stateless service? Now I know a component has a much richer definition than I'm limiting it to, but this is just the point. To what extent can we, and should we, use components within Flex?

Islamorada Restaurant - Melbourne, FL

Brian LeGros | December 13th, 2007 | food  

NOTE: Islamorada Restaurant has been closed and re-opened as Cocomo's Grille, an island inspired restaurant.

Since moving from South FL, I've been looking for a really good Cuban restaurant in the Melbourne area. I'd heard a few people mention Cuban Sandwich down on Babcock, a place in downtown Cocoa Beach, and Islamorada Restaurant in Suntree. I figured I would give Islamorda a shot since it was close to the house, but after I learned they were only open for dinner, I was a little disappointed. Recently, however, in our local community paper, Islamorda has started to advertise about their new hours and lunch menu. This is great news to me; I finally lucked out and was able to try something other than a Cuban sandwich thanks to lunch pricing. That being said, I found that dinner pricing was a little steep, but nothing more than can be expected for a specialty restaurant.

Islamorda is a quaint little restaurant located right next to the YMCA in Suntree. Islamorda combines Key West and Cuban cuisine into what turns out to be a really tasty fusion. Additionally, the atmosphere is cozy and the wait staff are polite. Now my favorite lunch choice has always been the "media noche" sandwich, but unfortunately Islamorada does not make them; they do however make some other very tasty alternatives. For lunch, my wife and I ordered the roast pork with moro rice and tostones (~$10), a Caribbean chicken salad (~$6), a soda (~$2, canned), and a side order of fried sweet plantains (~$3). Our meals came with Cuban-style rolls and their great candy-like, whipped key-lime butter. Our food arrived after a few minutes, nice and hot. The roast pork was delicious, stewed with onion and seasonings; a little Mojo sauce added some nice flavor to it as well. You can't lose with moro rice, tostones, and fried sweet plantains which were prepared equally as well. The Caribbean salad was a great blend of lettuce, tomatoes, croutons, carrots, pinneapple, and olives served with single breast of chicken marinated in a jerk-like seasoning and grilled. The salad came with a single serving of the raspberry vinaigrette, but you may want to ask for one more due to the salad's size. It would have been nice to see more darker green leafy veggies in the salad as well, but it still tasted great.

Overall I'd say Islamorada Restaurant is a definite, "must visit" for residents of the Melbourne area. Good food and good people have made our experience there a pleasurable one. Look for their "10% off one entree" discount coupon in the Suntree/Viera paper while it lasts.

Islamorada Restaurant is located in the YMCA plaza at 6300 N Wickham Rd, Melbourne, FL.

December Adogo Meeting Tomorrow Night

Brian LeGros | December 4th, 2007 | news  

If anyone is in the Orlando area tomorrow night, stop on by the Adogo meeting! We will be raffling off a license for ColdFusion 8 as well as giving away great Adobe stuff to anyone in attendance. Luis Majano will be giving a presentation on the latest version of ColdBox as well as an overview of the framework. Also, I will be leading a BoF on the multitude of ColdFusion frameworks that we have access to as a community. Hopefully I can encourage a good amount of discussion like Max did for our RIA BoF back in August.

Hope you stop by tomorrow, 12/04, at our usual time (7:00 PM) at Devry in Millennia. Highwinds Network Group will be sponsoring the meeting and bringing food along, so worse case you get fed and enjoy some casual CF conversation.

Dragon China - Dr. Phillips, Orlando, FL

Brian LeGros | December 1st, 2007 | food  

My colleagues and I have been looking for a good Chinese place near work. We tried 1-6-8 Chinese on Turkey Lake as well as a place down on Westwood Drive and I-Drive, but didn't really find anything we liked. This week we tried Dragon China in the Publix plaza on Sand Lake Blvd. It's a small location in the strip mall, but when you walk in the place is clean and the people are nice.

We kept it simple and went with the lunch combinations (~$6). Each combo has an A or B option; A is the meal and rice, B is the meal, rice, and an egg roll or soup. We ordered the Pork with mixed vegetables, pork egg foo young, Mongolian chicken, and bourbon chicken as well as the wonton soup, hot and sour soup, and an egg roll. Additionally, for $1.50 you can add brown rice to any meal. The egg roll didn't seem to be anything too special. The wonton soup was your basic chicken stock with scallion and wonton. The hot and sour however was done pretty well; it was made with a nice variety of fresh mushrooms, bamboo, and spices and wasn't too salty. The meals themselves were pretty good made with fresh veggies and lean meats. The brown rice was equally as good and a nice option with our meals.

The food came out quickly, was hot, and our glasses were always filled. Hot tea is free, so that is a huge plus for me. Overall Dragon China makes lunch easy while tasting great. If you're in the Dr. Phillips and need a good Chinese restaurant, definitely keep this one in mind.

Dragon China is located in the Publix plaza in Dr. Phillips at 7538 W Sand Lake Rd, Orlando, FL