Posts

Collect your own Garbage! (Objective C iOS platform)

I am my own garbage collector. I have to do it both in my house and when developing in Objective C (iOS platform) (seems like i can't escape this at work and home). I have created a prototype of an iPad application and i have to crash and learn Objective C.I have a strong background in Java which pampers developers with its automatic garbage collection even though you can force garbage collection in Java rest assured that it is there in the background. It is whole different story for Objective C for the iOS platform. This is probably one of the reasons why Java is successful among the language that gets its DNA from the C, C++ language. Object Initializer In Java you use the "new" keyword to create Objects. One step and your finish. In Objective C it is a two step operation you have to allocate and initialize ("alloc" and "init" respectively). The "alloc" makes the space in the heap for class' instance variables. The "init" in

The "Black Sheep" Way of Answering Inquiries from Managers

This is what i will be discussing in my Technical Communication class. We can pick a topic that is familiar to us. Since i have been teaching my daughter to read I became really familiar with nursery rhymes. I am going to take my classmates all the way back to nursery. Baa, baa, black sheep , Have you any wool ? Yes sir, yes sir, Three bags full. One for the master, One for the dame, And one for the little boy Who lives down the lane. Introduction Before we discuss the things that we can learn from the black sheep, we need background to relate this simple nursery rhyme to a management context. Who is asking the question “Have you any wool?” We know that it is not the “Master” because later on the sheep said “One for the master” which implies somebody other than the “Master” is asking the question. The sheep referred to the one asking the question “Sir” which is acknowledging the authority of the one asking to ask the question. We can deduct that the one asking the question is somebody

DWR - Ajax made easy

Image
Web Users wants more! Web users are now demanding web applications to be interactive in nature and as responsive as their desktop applications. The interactive nature of Desktop applications seems out of reach for web based applications until a new approach came to be known as AJAX (Asynchronous JavaScript and XML). AJAX is a convergence of different technologies so that web applications can mimic the interactive nature and responsiveness of Desktop applications. I want to use AJAX Now! There are several AJAX frameworks that can be used and DWR is one of the most popular Ajax frameworks out there. There are 3 ways of how AJAX interaction are designed: 1. Content-Centric This approach will directly insert HTML into the client page 2. Data-Centric Information or data is received from the server in XML or JSON . 3. Script-Centric JavaScript code is received from the server. The response from the server will include JavaScript code. Among the 3 ways above i prefer the Data-Centric approac

Runtime.exec() pretty exciting stuff

The Challenge - why i can't ignore the small stuff I have been creating batch job processes that will call EJBs. The issue with this is that the Application server process runs under a certain user id. The user id might only be accessible to a certain group that maintains the Application servers like a middle ware group. With this, any file that is written out by the EJB process in the application server will be created using the user id running the process. Security access to the output files by the process will default to the user id of the application server process. So, i want to write a file that has a different user id than the user id of an invoked java process. for example, if a java program was invoked by a user id A1234 i want the file to be written under a different user id B5678. Simple enough ? (Please take note that i am running the java process under a unix environment) My approach to the challenge I don't think there will be any utilities in Java that i can use

Google Web Toolkit -- adapting pains and issues

I have been first exposed to GWT on November 2006 and in one of our Java User group meeting. At that time we are looking to replace our ancient applet based web application. I saw the similarities on how GWT is similar to Java Swing in some of its components. Surely enough our group adapted and went with GWT. Here are the major issues that we have encountered. The issues are based on some wrong assumptions about GWT. Here is some points that our team missed about GWT. - GWT is JavaScript - JavaScript is executed in the clients Browser - GWT is not a web application framework - Be Aware of GWT Security issues GWT is JavaScript Even though GWT is coded using Java and leverages Java Tools, at the end of the day it is still JavaScript. So it is subjected to JavaScript issues like the following: - Threading - JavaScript is event driven and has single threaded model for development. So codes that are executed will be solely based on events. - Code size - even though there is no limit on how

Web Services - separation of definition and implementation

Understanding Web Services. Services has been in our desktops for years. If you have a PC , Go to Control Panel --> Administrative Tools --> Services. The web is taking an evolutionary leap to adapt this software architecture which has been very successful in our desktops. What is a web service ? In my approach in trying to understand what a web service is we go to the basics, find a definition of what a web service is. Here is the definition from the W3C web site (http://www.w3.org/TR/2004/NOTE-ws-arch-20040211/). A Web service is a software system designed to support interoperable machine-to-machine interaction over a network.It has an interface described in a machine-processable format (specifically WSDL). Other systems interact with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards. From the definition above we can infer the following: 1. intero

Java Generics - Be careful with SubTypes

In Java versions before the Tiger (Java 5.0) a Collection as we know it, will only contain Objects . The compiler knows that any Object can be put in the collection. The inability of the compiler to identify the intent of the programmer to use a collection of a particular type probably caused a lot of time spent on debugging ClassCastExceptions . Hello and Welcome Generics Generics in Java 5.0 (and versions after) will allow you to define a type for a Collection. The use of generics is not limited for typing Collections but I will only touch on this subject because it brings me great joy to know that i can express during compile time that i want a certain type of Collection. It was really a pain to experience it during runtime, specially when you need to deploy an application. Before Java 5.0 Sample code for a Java Collection before Java 5.0 Here is a sample code on how a Collection is used before Java 5.0 1 List listFoo = new ArrayList() ; 2 listFoo.add(new Foo()); 3 Foo aFoo = (Foo)