What makes a good BA?
The BA performs an important role in the application development process and is tasked with the duty of ensuring that the IT business solution meets the needs of the business. The BA develops and maintains the business and functional requirements that the IT business solution must contain in order to be deemed successful.
So we know the role and duties of the BA during a business application development project, so what “skills, knowledge and personal characteristics” does a person need to have to perform these duties. As the duties of the BA entail eliciting requirements from stakeholders and working with an application development team, you can imagine that communication is at the heart of the competencies of a BA. Good written and oral communication is necessary in order to be able to perform these duties. Good communication is not only departing information, but taking in information, or listening. This is often the skill that is over looked when we talk about skills or create a competency model.
Notice that when discussing competencies, that we not only are talking about “skills”, like Decision Making, Creative Thinking, Learning and Problem Solving; but we are also considering “knowledge” and “personal characteristics”. As the BA has to work with both the business and information technology staff, they need knowledge of the organization, industry and technology. What kind of personal characteristics would you want in a person that serves such an important role? I am sure ethics and trustworthiness would make the top that list.
So if you’re a BA looking to advance your career, there are some competencies to work on. If you’re an organization or manager looking to hire a BA, look not only at their skills and past performance, but develop some probing questions that will give you a look into their “underlying competencies”.
Where Does the BA Fit into Your Organization? Part two
Once a project is approved by the governance body it is turned over to the Project Management Office (PMO) to guide the project to completion. The PMO will be staffed with project managers (PMs) and business analysts (BAs) that will guide the project the rest of the way through the project life cycle. You may be asking why you would need BAs as part of the PMO, or project leadership team; after all the PM is responsible to see the project is completed on-time, on-budget and on-schedule. Yes, but the BA would be responsible to see that the project is completed and the IT business solution meets the business requirements. A business application development project will need functional and technical specifications that the BA should help develop.
The third role of the BA, I alluded to in my first post on this subject, is that of the Test or Quality Assurance Analyst. One role of the BA is to support the system, quality assurance and/or user acceptance testing phase of the project life cycle.
So the answer to the question ‘where does the BA fit …?” is in many positions within the organization. It depends on which BA role you wish to discuss, and whether the organization is large enough to have a BPO and/or PMO.
Any thoughts on the subject?
Where Does the BA Fit into Your Organization?
This is the question that many organizations are still trying to answer today. Many organizations are just realizing the benefits of the BA role. One thing to realize, is those of us in the BA arena today are in the forefront of an infantile and growing profession. The International Institute of Business Analysis (IIBA)®, the professions governing body, was formed in 2004; incorporated in 2006. There are 827 certified professionals (CBAP)® in the world. Compared to the Project Management Institute (PMI)®, which was incorporated in 1969, offer five certification programs and has nearly 300,000 certified professionals. You may say that your company has had BAs for the last 5 or 10 years. Then I say your company is one of the forward-thinking organizations that has recognized the benefits that the BA role provides in developing IT business solutions.
Now I believe this discussion will go on for years; but as this is my blog, here I get to put my two cents in. First, let’s define the role of the BA in which we discuss. Many organizations have a quality assurance team, department or processes within the IT application development team. As these people support system or user acceptance testing procedures, these people are Business Analyst. For this discussion, I refer to the Business Analyst that works on the front end of the project life cycle. Who develops the Enterprise Architecture, gathers business requirements for business process improvements and makes the business case for IT business solutions projects to make those improvements.
As the role of the BA is to develop requirements and make the business case for IT application development projects, this is an IT function; therefore the BA is an IT position and should report to the IT management as opposed to the Business management. Although the duties that the BA performs may put him/her in front of external customers of the company, their goal is not to perform the business of the company but to recommend IT business solution projects to improve business processes within organization; this is an IT function.
If your organization is large enough to use terms such as Business Process Organization (BPO) and Project Management Office (PMO); then you should find the BA at the heart of the BPO. The purpose of the BPO is to analyze and recommend improvements to business processes. So now you say that in most organizations the BPO is a business team; I would reply that it should be a combination business and IT team. The improvement to business processes may require a business solution, such as upgrade or replace business machinery or training; or an IT solution, such as application enhancement, system training or system upgrade. Therefore, the BPO should be made up of business positions and IT positions working together to determine the best solution to business issues.
One thing that I would change in many organizations is that I believe the BA should sit more in the vicinity of the business unit(s) that they support as opposed to sit in the IT Department. BAs will be much more effective when they fully understand the business processes in place, issues that business workers face and the daily going-ons within the business unit(s). Also, easy approachability to the BA for the business gains buy-in to the duties and recommendations of the BA.
So there is my opinion on the subject, what is yours?
Stop Whining
I don't often get on my soapbox, but I feel it's time for this. Stop whining! This refers specifically to application development, but I guess it can be applied to most everything. The point I am talking about is application frameworks.
I am using JavaFX, which is relatively new. The problem it is trying to solve is to remove the cruft from desktop application development (Swing), add 2d animations, and be able to run on a variety of devices and platforms. For me the holy grail of Java development would be to create an application that runs on mobile, desktop, and browser, all using the same code! JavaFX does this nicely. Some application development people won't even look at it because features like menus are not there yet. Are there some things missing? Yes, but there is a difference between “where's function X?” and “Epic fail! I can't do anything because function X is missing!”.
All languages, especially new ones have holes in them. You must learn to work around things, that's why I call myself a hacker. Would I want to have something work out of the box? Of course I would, but I also understand that knowledge comes with getting your hands dirty. Just because I can't drag and drop a control doesn't mean it doesn't work. I think the rule of thumb for me is, if the work takes more code than the application I am working on, then's it's broken. I think the whining is more apparent in the younger guys, because of the great things we can do in our IDEs. Not to sound like a greybeard (but I will anyway) is that I started coding Java in NOTEPAD! The same is true with HTML and XML. I love that code completion and other useful features have become standard now, but I bring this point up for a reason. I know how to fix it when breaks, because I know how it's put together.
Sure code is tough, but if you think writing an application is tough, you should see what it takes to write an API. The application development “magic” doesn't write itself. If something doesn't work right, investigate it, instead of complaining. You may have the key fix to make it great. I know you will learn something during your research. You can't drag that control, so you will wait until it's so easy, even a caveman can do it. If you do, you may be replaced by a cheaper caveman.
Too Little, Too Late.
I am part of the LinkedIn community and a member of several groups in LinkedIn. One of the groups I am a member of is the IBM i Professionals group. I get a weekly summary of activity and sometimes there are comments on the posts that people have made. Usually there are no more than 3-5 comments. What caught my attention is a LinkedIn post that had 23 comments. The original post referenced this blog post: http://blog.angustheitchap.com/?p=159 In this post, the author talks about the iSeries application development community needing to pull together to DO something about the lack of support for the platform. He asks the question: What have YOU done for the IBM i platform this week?
As a former iSeries application developer, I thought it was a good question, perhaps about 10 years too late, but a good question none the less. Let me state for the record that the iSeries is a great platform and it is without a doubt the best box for business that IBM has.
The problem is that it is a victim of its own success. There is no other platform where an application written in the 1980’s could still run un-touched even though the underlying hardware has changed numerous times. To me the core issue is this: IBM is no longer in the hardware business; meaning they don’t derive that much revenue from hardware anymore. The majority of IBM’s revenue comes from services. The iSeries does not need or generate the services revenue that other platforms do. So in my opinion, it’s an economic issue and no amount of doing or community is going to change that.
IBM, Java, and the Community
I recently read an article about the state of the IBM “i” and the amount of complaining by IBM application development and business partner folk. I know several RPG application development folk, and it sounds familiar. That made me think about my Java Application development and career. Are there things to complain about, and uncertainty about the future? Yes, but there are 2 reasons why the Java community is in a better place; the business model and the community. Before the IBMers call for a holy war, I said COMMUNITY! I am not talking about the strengths or weaknesses of the hardware or software. The business model for IBM is that they make the hardware and software, and partner for the sales and service. I think that is a viable model until IBM competes in the sales and services with their partners. If a lead is brought in by a small partner, they are awarded by giving the business to someone bigger. This sets up a confrontational relationship between IBM, the big partners, and the little partners. IBM can also decide whether or not you are worthy to be a partner. Why does this affect the software application development team? Because most consulting firm are selling SERVICES not HARDWARE. If they are not seeing business because of political fighting, they don't have to sell it. There are viable options on other platforms, where interference does not happen. IBM never fostered a community, they created a hierarchy with themselves as the head.
Certainly Sun has done some things that made myself and others unhappy. Besides, complaining, we actively pushed to remove barriers in our path. We do have an open source Java. Is there a IBM community that can work with RPG to make it work for them? I also think its about scale and timing. It's not like IBM software developers have their own AS/400 at their home. It's easy for me to create and use nearly any kind of application at my home in Cincinnati, and pretty cheaply. It makes it fun to tell non-technical people about my application development. Nobody but accountants want to hear about accounting programs. Java, and newer languages have grown up with the Internet. I have friends from all over the globe that have similar interests. If I have a problem, I can go online to a forum, friend, or web page to find what I need. I can read and write blogs to voice my opinion (like now). These things are not ingrained in the Legacy community, and in fact, have been actively campaigned against. It is my belief that any software, hardware, or service will die when there is no vocal community to support it.
My Learning Recipe
As a consultant and application development person, I have to learn new things all the time. Take for example, my work with JavaFX. The language does have some familiar aspects, but there is a lot new there too. How do you go about learning something new? I have come up with some guidelines that I use in learning new things (in this case a language):
- Read as much about it as you can first. No one wants to wade through tomes of technical information, but that is where you learn. I try to get a feel for what problem the new thing is trying to solve first.
- Understand the core elements. Whether it's a programming language, a car, or a philosophical construct, knowing how it works is the first step. I know it's time to go to the next step when I have some ideas on how to use the item, and I start formulating a project.
- Examine and breakdown examples, if you can. You would be surprised at how many application development people think they're “smart enough” to figure out how things work just by following a few examples. I don't know about you, but I don't figure out a complex things just from a few simple “Hello World” examples. That being said, seeing how things works is the quickest to way get a basic understanding. Couple that with knowledge you acquired by reading the manual, and you get the “why” of how it's put together.
- Create your own knowledge base. I like to Google more than most people, but things do need to get done. I will create a separate folder to contain links to examples, other application development team members' blogs, white papers and other documentation. If you can, create a “how-to” WIKI. Having a centrally located repository makes it simple to answer questions.
- Create a test project. I do this especially for languages. I create a test project where I can test specific “how do I?” questions. It keeps you from removing code, adding unnecessary functions, and commenting and uncommenting code in your main project. Figure it out in its own project first, then transfer the code and knowledge to your main project. It is always good to revisit it after a period inactivity.
- Write or teach what you learned. As application development people, we tend to get blinders on when doing something. Having a different set eyes, or different questions being asked makes you examine what you actually know.
So there's my “Secret Sauce” for learning. You still have to come up with ideas on how to utilize you knowledge though.
Takin’ the Basset Hound to the Farm (Part Two)
In part one; I talked about some of the IT Strategies and business strategies that were discussed at the Techserve Alliance conference we recently attended. I’ll admit I’m a sucker for quaint sayings and one of the speakers had a good one: It’s time to take the Basset hound to the farm. So what does that have to do with IT Strategy or business?
Plenty, takin’ the basset hound to the farm means it’s time to re-think what you are doing, why you are doing it, and who is doing it. It’s time to eliminate products, services, processes or people that are not delivering value to the business. This is not just an IT strategy, but an important business strategy as well. It is critically important to make sure both business and IT are aligned.
The trick is to figure out what your basset hound(s) are. Every business that has been around for any length of time has one or more of these. It may be a line of products that are kept in stock because it “rounds out the product line”, when the reality is the items are not that important. It could be a service that our “customers really want”, but in reality the service does not deliver value or it could be that “special process” that you do “because we have always done it that way”. Then there is Bob. Everybody likes Bob. Bob has been around forever and knows everything. The problem is Bob doesn’t really do anything.
It’s always better to take the basset hound to the farm on your own terms rather than be forced into it by circumstances. Take for example the company in New England that manufactured parts for submarines. When the ship yard closed a few years ago, they were forced to change. They redeployed their manufacturing expertise and now make parts for the medical industry. What could they have accomplished if they had manufactured both parts for submarines and medical devices? Could the business have been double the size?
That’s where an outside consultant can help. They can be objective and bring an outside perspective to your current business and IT strategy. STAR BASE is in a good position to teach old dogs new tricks”. (Who let the dogs out? Who? Who?!)
Working with Magento
People outside of Cincinnati may be shocked to know that I work with languages OUTSIDE of Java! I don't know any application development person, especially one who does web application development who doesn't use several languages. I have recently been working on Magento. What is that you say? Magento is an Open Source PHP ECommerce application based on the Zend Framework. You don't need to download Zend, just the Magento PHP files. We actually have Magento internally setup with a LAMP package, but I already have MySQL and Apache on my local machine, so I thought I'd tackle and individual install. The verdict? Well after a couple of small hiccups (don't use the Windows install for PHP, just unzip, and localhost needs to be a virtual host), setup was a breeze! Fortunately, STAR BASE, Inc. has enough experience to over come these issues. Magento is easy to customize products and catalogs, and would be a good choice for organizations to create their own ECommerce site. Magento is easy enough to implement without an IT Consultant, but an experienced consultant can save you time and frustration.
Using Zembly
Does Stakeholder sign-off guarantee success?
You have a 50% chance of getting this one right; do you want to ponder a guess? The goal of requirements gathering is to achieve stakeholder sign-off of the business requirements of the project. So let’s say you do everything right, you go through a few phases of requirements elicitation using several different elicitation techniques. You put together a well crafted Requirements Document and get the project primary stakeholders to sign-off on it. All this happens before development begins. You are on the right track. This is going to be successful, right? Your business solution developed by your IT staff is going to fulfill all the project requirements and be a huge success.
Kupe explains how the Dallas Cowboys went through all those steps. They went above and beyond the NFL requirement. Received sign-off from the NFL. They built their new stadium with a very impressive jumbo-tron above the field. Sixty feet long, 90 feet above the field. Anybody see a problem here yet. Well evidently neither did the Cowboys nor the NFL; until the third quarter of the first preseason game of the season when the opposing team’s punter hit the jumbo sized screen with his kick. This caused a do-over in the game, and I now understand that they have an extra official at the field whose job is to ensure that any kick does not hit the video screen.
So the IT business solution didn’t work for the stakeholders, namely the Dallas Cowboys and the NFL. So where did they go wrong? Kupe goes on to describe the flaw in the height requirement that made the end result unsuccessful.
This is a prime example of going through all the right steps, get the stakeholders sign-off, and the business solution does not deliver the expected result. So the Business Analyst job in the requirements gathering phase of a project is not only to gather the requirements that the stakeholders are telling you, but go beyond that and capture the requirements that the stakeholders either haven’t thought of, or just don’t know. Kupe’s article gives good point that simulation of punting in the stadium might have drawn out the flaw before the one million ton video screen was installed. Now how much will it cost to move that? Simulation is not one of the requirements gathering techniques that the IIBA® emphasizes, but most certainly can be used as such when the circumstance dictates.
The moral of this story is to be sure to use the correct requirements gathering techniques to draw out all the business requirements so that your end business solution will meet the needs of the stakeholders. That is what will ensure success of your IT business solutions.
Teaching Old Dogs New Tricks
I was in a meeting discussing the logistics of transferring multiple gigs of text data across the internet. The source computer was an iSeries, the target was something else. Much of the discussion centered on network latency and the time it was going to take to transfer that much data, and how processes were going to have to be pushed back a day because the window was too short. Well I said why don't we just zip up the file and send it that way. Data files tend to be highly compressible, up to 90%. "Can you do that on an iSeries." That was the infrastructure guy. Why not, I can run Java on it. I shouldn't be too hard to find something, even if I have to write a simple Java program. "Don't do anything we won't be able to understand." That was one of the RPG programmers. IMHO, the legacy tag belongs with those who use the technology, and the technologies they choose to use rather than with the hardware and operating system. For me it was a challenge.
A day later I had a working command using a tool that is bundled with every Java Development Kit. I knew this, but it took a slight memory jog from a college to remind me. A JAR file is a ZIP file with a different extension. IBM explicitly provides a tool to convert a database file to a CSV file, or a flat text file, but to compress that file into a ZIP file you need to use the JAR utility and give the file a .ZIP extension. Works like a champ. IBM even provides an alternate JAR utility that acts more like a command line compression utility to create zip files, but instead of calling it zip, or izip or something like that they call it ajar.
Well, a short CL later and I have a full featured program that takes a database file name, a zip file name and path (in the integrated file system or IFS), and a format selector (*DLM or *FIXED). It probably would have made more sense to name that format *CSV instead of *DLM, but IBM's conversion utility calls it *DLM. The output is a zip file with the name and path as specified in the input parameters.
And Here it is:
PGM PARM(&DBF &ZIPFILE &FORMAT)
DCL VAR(&DBF) TYPE(*CHAR) LEN(32)
DCL VAR(&ZIPFILE) TYPE(*CHAR) LEN(255)
DCL VAR(&FORMAT) TYPE(*CHAR) LEN(6)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCL VAR(&MBR) TYPE(*CHAR) LEN(10)
DCL VAR(&CMD) TYPE(*CHAR) LEN(255)
DCL VAR(&TEXTFILE) TYPE(*CHAR) LEN(15)
DCL VAR(&TEMPFILE) TYPE(*CHAR) LEN(40)
DCL VAR(&ERRLOOP) TYPE(*CHAR) LEN(1) VALUE(N)
DCL VAR(&INTER) TYPE(*CHAR) LEN(1)
MONMSG MSGID(CPF0000 QSH0000) EXEC(GOTO CMDLBL(ERROR))
RTVJOBA TYPE(&INTER)
CHGVAR VAR(&FILE) VALUE(%SST(&DBF 3 10))
CHGVAR VAR(&LIB) VALUE(%SST(&DBF 13 10))
CHGVAR VAR(&MBR) VALUE(%SST(&DBF 23 10))
/* Ensure ZIP directory exists for error logging */
MKDIR DIR('/zip')
MONMSG MSGID(CPFA0A0)
/* Delete &zipfile if it exists */
RMVLNK OBJLNK(&ZIPFILE)
MONMSG MSGID(CPFA0A9)
/* build text file name */
IF COND(&FORMAT *EQ *DLM) THEN(DO)
CHGVAR VAR(&TEXTFILE) VALUE(&FILE *TCAT '.csv')
ENDDO
ELSE CMD(DO)
CHGVAR VAR(&TEXTFILE) VALUE(&FILE *TCAT '.txt')
ENDDO
/* generate temporary file name */
RTVTMPIFSN NAME(&TEMPFILE)
IF COND(&TEMPFILE *EQ ' ') THEN(CHGVAR VAR(&TEMPFILE) +
VALUE('/tmp/$$__tempfile'))
/* export DBF to temporary file */
CPYTOIMPF FROMFILE(&LIB/&FILE &MBR) TOSTMF(&TEMPFILE) +
MBROPT(*REPLACE) STMFCODPAG(*STDASCII) +
RCDDLM(*CRLF) DTAFMT(&FORMAT) RMVBLANK(*TRAILING)
MONMSG MSGID(CPF2817) EXEC(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Error +
converting Database File to Interface File') +
MSGTYPE(*DIAG)
GOTO CMDLBL(ERROR)
ENDDO
/* Send 'compressing' status message */
IF COND(&INTER *EQ '1') THEN(SNDPGMMSG MSGID(CPF9897) +
MSGF(QCPFMSG) MSGDTA('Compressing file ' *CAT +
&FILE) TOPGMQ(*EXT) MSGTYPE(*STATUS))
/*---------------------------------------------------------------*/
/* This command is using the unix environment to zip up the file */
/* extracted above. All errors are logged to a text file */
/* named error.txt. The 2>> operator redirects stderr to the */
/* file following it, and adds any messages to the end of the */
/* file. */
/* */
/* The following unix utilities are used here: */
/* ajar - create an archive */
/* */
/* The following environment variables are used here: */
/* QIBM_QSH_CMD_ESCAPE_MSG - Sends QSH0005 as an escape message */
/* if the exit status is not 0 (Qshell error condition) */
/*---------------------------------------------------------------*/
/* Send an escape message if the command fails */
ADDENVVAR ENVVAR(QIBM_QSH_CMD_ESCAPE_MSG) VALUE(Y) +
REPLACE(*YES)
/* Create &zipfile from temporary file */
CHGVAR VAR(&CMD) VALUE('ajar -c -M' *BCAT &ZIPFILE *BCAT +
'''' *CAT &TEMPFILE *TCAT ''' :' *BCAT &TEXTFILE +
*BCAT '2>>' *BCAT '/zip/error.txt')
QSH CMD(&CMD)
MONMSG MSGID(QSH0005) EXEC(DO)
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Error +
creating ZIP file') MSGTYPE(*DIAG)
GOTO CMDLBL(ERROR)
ENDDO
/* Delete temporaty file */
RMVLNK OBJLNK(&TEMPFILE)
MONMSG MSGID(CPFA0A9)
/* Exit Normally */
GOTO CMDLBL(OUT)
/* Process Errors */
ERROR: IF COND(&ERRLOOP *EQ Y) THEN(GOTO CMDLBL(OUT))
CHGVAR VAR(&ERRLOOP) VALUE(Y)
/* Delete temporaty file */
RMVLNK OBJLNK(&TEMPFILE)
MONMSG MSGID(CPFA0A9)
/* Send Escape message */
SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('Error +
Processing File') MSGTYPE(*ESCAPE)
OUT: ENDPGM
Check it out. Create a ZIP file using the Java Archive utility. A Rose by any other name would smell as sweet!It’s More Than Code!
As I wind down from my client in Cincinnati, I have been reflecting on the job of technical consultants. In my previous posts, I have reviewed my knowledge and understanding of code. But there’s more to my job, and really all application development members’ jobs than code knowledge. A technical consultant needs to know the internal political climate, the processes in place, and the personnel. The client may be risk averse to technology change, or open source software. It could be a corporate edict, or it could be that your client doesn’t know the benefits of the new technology. The processes may be flawed, but are flawed for a reason. A good consult needs to work within the existing process, move that process to a better one if needed. People are always initially wary of technical consultants, because they fear that they will be replaced. Conversely, technical consultants are keenly aware that they are replaceable, and that they should be replaced, if they have done their job right. A good technical consultant knows the trends, but also knows to read people. Which ones need assurance that their job is not in danger, which ones should focus more on their job, and which ones are ready to pick up new ideas. A good technical consultant has confidence in his abilities, but isn’t afraid to learn new ideas from others. I consider an assignment a success if I have left my client in better shape than when I arrived. I am many things, including an application development person, but my job is more than code.
Never Stop Learning
I am finishing up with my client in Cincinnati. I am trying to clean up code from the vendor, when an interesting error occurred. That’s when I decided to poke around and look at some place for better coding practices. As any Java software development person knows, "Effective Java" is about the best book there is on Java. It’s a must have book. On The web, I have found this site that has some great coding practices. Technology, and specifically Java, is a fast moving animal. What was valid 5 years ago, may not apply, or even exist, now. Searching the Internet is great for information, but you have to be careful too. I try to avoid any article written before 2006, unless it directly applies to the subject matter. Take string concatenation for example, common wisdom says to not use the "+" for concatenation. Use a StringBuilder object. If you are on 1.4.2, you don’t have that object, you have StringBuffer. Well performance wise, which works best, and what kind of performance hit do you get? The only real way to tell is to write your own test class, and call JavaP. JavaP allows you to see the byte code operations. Sometimes you may have only a few operations which would be unnoticed by your users. If repeated often enough though, you could have a real performance problem.
I have noticed that many application development people, and really all people, find a fact that they have read, and use it in their daily job. Facts, like technology change, and the best way to know is to prove it yourself. I have come to write little test classes to work out code I haven’t done before. That way I can understand just what is going on before I introduce it into my application. I have been applying that same concept to accepted performance practices. Profiling applications is also a great way to "see" what your code is doing. The best thing for application development members to do is never assume anyting works as planned, and never stop learning.
Never Assume Anything
My client in Cincinnati is having issues with one of their Java based web applications. The application is throwing an out of memory error. One of the vendor's application development personnel traced it back to a local byte array object. He said "it can’t be the problem because it is created in a method. I don't have to null the object because it is garbage collected". In Java, you are taught that any variables created in a method call persist only for the life of that method call. When the method has completed, all objects are out of scope, so they are to be garbage collected. Java uses implicit object creation and destruction, so the application developer can focus on the problem. Like any rule though, there are exceptions. If your local variable is referencing an external object, and that reference is still live, your local object still persists in memory. Since the method has been garbage collected, the object will stay in memory and not be freed until you restart the server. The best example of this is creating a database connection object. If you don’t call the close method and null it, the object will persist until the JVM is shut down. This called a stale connection. Even though you may have created the connection in a method, the object doesn’t get collected. Look at the following code:
package test;
public class MemTest
{
private final int dataSize = (int) (Runtime.getRuntime().maxMemory() * 0.9);
public byte[] func()
{
byte[] data = new byte[dataSize];
System.out.println("func: byte array created in func");
System.out.println("func: Total Mem=" + Runtime.getRuntime().totalMemory()
+ " Free Mem=" + Runtime.getRuntime().freeMemory());
return data;
}
public static void test()
{
MemTest jmp = new MemTest();
System.out.println("Max Mem=" + Runtime.getRuntime().maxMemory()
+ " dataSize=" + jmp.dataSize);
System.out.println("Total Mem=" + Runtime.getRuntime().totalMemory()
+ " Free Mem=" + Runtime.getRuntime().freeMemory());
byte[] data1 = jmp.func();
System.out.println("byte array returned in jmp.func, size=" + data1.length);
System.out.println("Total Mem=" + Runtime.getRuntime().totalMemory()
+ " Free Mem=" + Runtime.getRuntime().freeMemory());
jmp = null; // this does not do anything as data1 still has a reference to the byte[] returned from jump.func()
// data1 = null; // if data1 is not set to null here to remove to the reference to the byte[], data2=jump2.func() will hit OutOfMemory exception
MemTest jmp2 = new MemTest();
byte[] data2 = jmp2.func();
System.out.println("byte array returned in jmp2.func, size=" + data2.length);
System.out.println("Total Mem=" + Runtime.getRuntime().totalMemory()
+ " Free Mem=" + Runtime.getRuntime().freeMemory());
}
public static void main(String[] args)
{
System.out.println("--test1--");
test();
System.out.println("--test2--");
test();
System.out.println("--test3--");
test();
System.out.println("--test4--");
test();
}
}
If you run this code, it will throw an out of memory exception. Uncomment the data1= null statement and run again. This application is the 1.4 JDK, and the newer JDKs are doing a better job at handling this situation. I also know that there are 2 things to remember in application development, don’t assume anything, and rules were meant to broken. I still have some testing to do, but I am sure my Cincinnati client will be happy.
What’s new at JavaOne Part 3 - The Sun Cloud and The End?
This is the last of a three part series; part one is here and part two is here. Many application development guys are wondering, what is the Cloud, and what is the Sun Cloud? Think of Cloud computing as a virtualized data center. In part one I talked about VirtualBox, which allows you to virtualize network components and resources. Think of VirtualBox working on the atomic level, taking small resources to create a virtualized network. Now Cloud computing takes all of the virtualized networks and utilizes them as resources in a virtualized data center. The Sun Cloud is a set of APIs to let you manage networks and storage areas as resources. You can cluster or categorize networks in any way you wish. You can manage user access to the resources, not unlike application development teams utilize in web applications.
What does all this mean to application development and management? It means that you can create a single network and copy or clone it. For example, you can create a single network instance with servers, storage areas databases, and clone the entire network for each region you manage. That means all networks are managed in one spot, and all regions are setup exactly the same. No application compatibility issues. You can, of course, add or remove components, but they are all have the same infrastructure. You can upgrade the virtual network, and pass the changes to the other regions. The electricity saved by running virtualized datacenters would be significant. You can connect to your partners’ virtualized networks to access their data. For application development teams, that would change how we design applications if we have access to external data and applications.
This was my fifth JavaOne conference. Since it is always at the Moscone center, I know pretty much every nook and cranny of JavaOne. Although smaller this year, I thought this was the best one yet. The people there were truly happy to be there, and combined with takeover news and a bad global economy, a bigger sense of cooperation. I would highly recommend coming to one if they still have one. Nobody, not even James Gosling (I was in a group of 20 who had a 45 minute meeting with him) knows if there will be one next year. The reason you come to JavaOne is not the presentations (they are great!), but the people. Meeting and befriending people who created your favorite blog, book, or technology is the reason to come. I remember meeting Craig McClanahan (co-creator of struts) in 2004, and saying "that’s Craig freaking McClanahan!" Last year, I was honored a share a picture of beer with him, Jarda Tulach (inventor of NetBeans), and Geertjan Wielenga (JavaLobby blogger extraordinaire). Application development people get to "network" with the best and brightest architects, technical press, and business owners. This year I got hang with the JUG leaders, NetBeans Dream Teamers, and the JavaFX guys. I wrote, and helped edit a YouTube video "pushing Java", and met more of my fellow Java music software developers. I literally have friends from all over the world (yes Cincinnati too), and I am considered an honorary Brazilian because of JavaOne. Larry Ellison, if you are reading this, please don’t stop JavaOne!
What’s new at JavaOne 2009 – Part 2 JavaFX, JavaFX Designer, and The Java Store
Part one discussed Open Solaris. Part Two is all about what is new with JavaFx and the Java Store.
I have talked about, and been impressed with JavaFX since its debut at JavaOne 2007. It was a key part of my presentation to Cincinnati area application development members that year. For those application development people who don’t know what JavaFx is, I blogged about it here. So what’s new really with it? The JavaFx in 2007 was JavaFX script. JavaFX was limited in where you could run the script. In January, JavaFX released its first runtime, and now JavaFX 1.2 is out. You can have graphic designers create media for your application using JavaFX production and easily import them into JavaFx. The JavaFx language can now be run on the desktop, web page or mobile device. JavaFx has been integrated with the new version of web start, but more on that later. New widgets have been created, and third-party widgets are being created at JavaFx widgets. There still are issues, though. Some swing like widgets like menus and tables have not been completely done. You can create a wrapper around Swing components, but it’s not the same as a native widget. Integration with NetBeans 6.7 isn’t there because of the new designer isn’t ready, but an update is scheduled at the end of July The reason I think application development teams should use JavaFX, is that the same code can run in multiple areas. I can now create a desktop application and have it run on the web and mobile devices without having to rewrite my code.
The JavaFX designer will help in a wider adoption rate of JavaFX for the things it can do. A big part of JavaFx is making animation simple to create. With the timer piece of designer, it’s a breeze. In the demo here, (starts 10:25 in) you can take an image, give it a starting point, and pick intermediate points and the times and the designer creates all of timings for you. You can bind media and widgets to data or events. For example you can drop a video and some buttons on the scene. You then drag a link from a button to the media, and all available actions popup (play, pause, etc.). Select the action in the popup and it’s done. Application development guys can create a media player in minutes. You can open different windows with different screen sizes, and all of the children inherit their changes from the parent. You can edit each screen though, and those changes are kept for that window.
What is the Java Store, and why do I need it? The Java store is a warehouse for free, and for fee Java applications. Right now, everything is for free while the community decides the best way to charge (or not) for applications. If you need an application quickly, you can check the store without having to do extensive searching, or worse, recreating the wheel. The cool thing about the store is its use of the new Web Start technology. Users can preview the application before keeping the application. If you decide to keep the application, just drag it to your desktop. It’s just that easy.
Come On In, We’re Open
The Cincinnati market is known for being conservative when it comes to using software. Most application development people I know would say that big software, from the big firms, either three lettered companies, or their name ending in “soft”, are the only code found in shops. There is the occasional open source item here and there, but usually in smaller shops. Why is that? Well, some firms don’t create their custom application development, they just enhance out of the box software. They need a vendor to yell at and fix things when it breaks, because their staff can’t fix the code, or don’t have access to it. For many firms, it is better to pay a vendor for support than to maintain it themselves. As long as you can point to somebody, it’s ok. Some firms actively fear that open source means that everyone will have their intellectual property somehow. They fail to realize that it is the same proprietary code that everyone uses too. Since, you have the source code, you can see if there is a backdoor coded in the application, something you can’t do with proprietary code.
With these fears aside, many firms, even in Cincinnati, are looking to use open source solutions for their issues. Certainly many are using the free (as in beer) code to save costs. I hope though that some firms will see how this free (as in liberty) also helps their business. It’s a tough call whether to purchase a pre-made business process package (I am looking at you SAP), or to roll your own. I think the best of both worlds would be to use an open source application, and to enhance it. It is a popular misconception that you MUST contribute code, or that you can’t change the code. You can create your own code for use; you can’t sell the application with YOUR enhancements as YOUR NEW application. There is some legal wrangling, yes, but the bottom line is that you have application development teams, so use them. Your best business plan is to use your process as a competitive advantage, not to shoehorn your process into software that all of your competitors use. I think the goal is to beat them, not join them.
The best thing to do is to give your application development team a couple of old boxes to play with, and let them do some research on applications that can save your money, and are flexible enough to work with your processes. You may end up with an inexpensive system, and get that application that outperforms your competitors.
Welcome to My World
http://www.youtube.com/watch?v=R2a8TRSgzZY
Check out this video, it’s so dead on. Many of us in the IT staffing industry have dealt with this first hand. “I can get <fill in IT skill> resources for $20 an hour less from XYZ". Companies’ sometimes act like they are buying a commodity product like copier paper, rather than skilled IT consultants.
No manger would ever dream of going to one of their employees and saying, I can get Bob to do your job for $10,000 less per year, yet it’s becoming more prevalent in the IT staffing business.
One of the huge issues facing our industry is the use of H1-B IT consultants. Our leaders in Washington are looking legislation specifically targeting IT consulting firms that use H1-B consultants to limit our ability to do so. This is in the interest of saving American jobs. Unfortunately, the bill currently being debated does not limit multi-national companies, so only the smaller companies will be hurt.
I would love to use local IT consultants for all of our engagements, but the price pressure dictates we do things we normally wouldn’t chose to do. But then again, we’re really just hurting ourselves.