[ieee the 2nd international conference on distributed frameworks for multimedia applications -...

6
Java: From "Hard Coding" to Using an Integrated Development Environment Ali R. Mustafa Kattan, Rosni Abdullah, Rosalina Abdul Salam Parallel & Distributed Processing Lab School of Computer Sciences Universiti Sains Malaysia 11800, Penang Malaysia kattan(&cS. usm. my rosin es. usm. m rosalina(kcs. usm. mny Abstract efficient [ 1 ] and spanning a wide range of heterogeneous systems. The model is yet to expand to Being a Java developer the decision of starting to use include more technologies as they emerge. an integrated development environment (IDE) Regardless of this complication, a program instead of a set of discrete programming tools, is to development cycle must exist though the stages of be taken sooner or later. This paper identifies the such cycle are more meshed and coherent than what favorite features to opt for, in selecting a suitable could be identified as a stage in the older languages. IDE, what should be used and by whom with plethora Many advanced design techniques and metrics are of such IDEs. Though IDEs are meant to facilitate offered to measure the design efficiency of the object program development and increase productivity, oriented programs being developed though such migrating developers might fall into a set of common design techniques and metrics do not provide an pitfalls that could hinder productivity. Such pitfalls over-all easy working solution [2]. In addition, are indicated and discussed in the view of available assuming that the techniques and metrics have been IDE features. used properly, testing and debugging is still a Keywords - hard coding, integrated development required step that might take 10% - 15% of environment, java programming, productivity development time [3]. This figure is much higher in case of beginners of course. 1. Introduction: Time & Effort Vs. With this added complexity to the program Productivity development process [4], tools that facilitate the different stages of this process become essential. The aim is "Productivity"; helping the developer to be "A successful individual typically sets his next p roductiveinte o lpring the proper code oal smewha but ot to muc abov hisproductive in termis of producing the proper code goal somewhat but not too much above his with minimal effort and within the least time [5]. last achievement. In this way he steadily Such tools could be either individual or merged and raises his level of aspiration." bundled in an (IDE): Integrated Development Kurt Lewin, a psychologist (1890 - 1947). Environment. Being involved for more than 15 years in the Based on experience, that is not always true. process of writing programs and teaching Unfortunately, such tools or IDEs could result in a process of writing programs and teaching drastic degradation in the intended "Productivity". It programming, from the old days of command line sometimes cripples this process resulting in an based OS up to using advanced visual environments ineficen code this des s being "por" that all serve the main purpose of writing code for Worst yet, the developer might fail to complete the some specific task, It was realized that such advanced code. This will result in some sort of frustration that enhancements that suppose to simplify the coding will cause the developer to "avoid" or "abandon" process, might add a great deal of complexity and using such tools. cause confusion to new programmers and All the common pitfalls that a migrating developer professional ones alike. might fall into are discussed indicating the IDE Programming languages have come a long way features associated with such pitfalls. The two since the early days of sequential code and procedural~ ~~ ~~~~, cod tobighgl,betoine categories of developers will most likely fall into ... , . ~~~such pitfalls are also highlighted. By presenting a offering a multitude of capabilities, being more comparison between using the regular discreet Java 1-4244-0409-6/06/$20.00 ©)2006 IEEE

Upload: rosalina

Post on 11-Mar-2017

218 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

Java: From "Hard Coding"to Using an Integrated Development Environment

Ali R. Mustafa Kattan, Rosni Abdullah, Rosalina Abdul SalamParallel & Distributed Processing Lab

School ofComputer SciencesUniversiti Sains Malaysia 11800, Penang Malaysia

kattan(&cS. usm. my rosin es. usm.m rosalina(kcs. usm. mny

Abstract efficient [1 ] and spanning a wide range ofheterogeneous systems. The model is yet to expand to

Being a Java developer the decision ofstarting to use include more technologies as they emerge.an integrated development environment (IDE) Regardless of this complication, a programinstead of a set of discrete programming tools, is to development cycle must exist though the stages ofbe taken sooner or later. This paper identifies the such cycle are more meshed and coherent than whatfavorite features to opt for, in selecting a suitable could be identified as a stage in the older languages.IDE, what should be used and by whom with plethora Many advanced design techniques and metrics areof such IDEs. Though IDEs are meant to facilitate offered to measure the design efficiency of the objectprogram development and increase productivity, oriented programs being developed though suchmigrating developers mightfall into a set ofcommon design techniques and metrics do not provide anpitfalls that could hinder productivity. Such pitfalls over-all easy working solution [2]. In addition,are indicated and discussed in the view of available assuming that the techniques and metrics have beenIDEfeatures. used properly, testing and debugging is still aKeywords - hard coding, integrated development required step that might take 10% - 15% ofenvironment, java programming, productivity development time [3]. This figure is much higher in

case of beginners of course.

1. Introduction: Time & Effort Vs. With this added complexity to the programProductivity development process [4], tools that facilitate the

different stages of this process become essential. Theaim is "Productivity"; helping the developer to be

"A successful individual typically sets his next p roductiveinte o lpring the proper codeoal smewhabut ot to muc abov hisproductive in termis of producing the proper code

goal somewhat but not too much above his with minimal effort and within the least time [5].last achievement. In this way he steadily Such tools could be either individual or merged andraises his level ofaspiration." bundled in an (IDE): Integrated DevelopmentKurt Lewin, a psychologist (1890 - 1947). Environment.

Being involved for more than 15 years in theBased on experience, that is not always true.

process of writing programs and teachingUnfortunately, such tools or IDEs could result in a

process of writing programs and teaching drastic degradation in the intended "Productivity". Itprogramming, from the old days of command line sometimes cripples this process resulting in anbased OS up to using advanced visual environments ineficen code this des s being "por"that all serve the main purpose of writing code for Worst yet, the developer might fail to complete thesome specific task, It was realized that such advanced code. This will result in some sort of frustration thatenhancements that suppose to simplify the coding will cause the developer to "avoid" or "abandon"process, might add a great deal of complexity and using such tools.cause confusion to new programmers and All the common pitfalls that a migrating developerprofessional ones alike. might fall into are discussed indicating the IDEProgramming languages have come a long way features associated with such pitfalls. The two

since the early days of sequential code andprocedural~ ~ ~ ~~~~,codtobighgl,betoine categories of developers will most likely fall into..., . ~~~such pitfalls are also highlighted. By presenting aoffering a multitude of capabilities, being more comparison between using the regular discreet Java

1-4244-0409-6/06/$20.00 ©)2006 IEEE

Page 2: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

programming tools and their drawbacks, to using IDE these tools could differ from the one thefeatures, an appreciation of such features can be developer is used to. Even if the final codemade. This will be discussed in the view of many accomplishes the intended task, the clarity ofactual freeware, shareware or commercial IDEs. such code could be lost.

g)Some IDEs offer instant help or2. Common Pitfalls programming tips while the developer is editing

his code or in case of detecting a syntax or a

Based on different observations and feedback from possible run-time error. Such tips, though shouldprogrammers, students and researchers [6] involved be useful, might take the developer intoin this process, some or all of the following scenarios "spaghetti" like help offering links to othercould happen for a developer just starting to use an related topics leading to never ending "loop".IDE. In all cases, the developer aimed productivity This also could cause confusion and might resultmight be affected negatively which might lead to in such tips being useless.confusion and frustration. Eventually, this will lead to h)After the intended code is completed, thefailure in finishing the required task. developer must "extract" the related resultant

a) With so many menus, icons, options, etc. the files to package and use on other systems. Thisdeveloper feels bewildered and not sure which of process could be complicated by the fact thatthese should be used. distinguishing the relevant files is not easy sinceb)The process of starting a new program the IDE might add its own configuration files

within an IDE could not be a straight forward along with the main code files (meta data files).process. It might involve creating some sort of The IDE could also use a custom file naming"Project" or "Task" that will require the system to generate the code files making thedeveloper to understand the concept behind process of extracting such files more difficult.before actually becoming able to write code.

c)Many IDEs offer different "views" either of The bottom line from the pitfalls above is that thethe code itself, or the modules that constitute the developer should be able to use the IDE tools to hisoverall "project" or "task". Such "views" could favor and not the opposite. Some of these tools forcecause some sort of confusion if their purpose is the developer into getting accustomed to certain stylenot clear to the developer. or method of coding. Though many of the IDEsd)Most IDEs work as a layer above the actual features are meant to be advantages for the developer,

language compiler and virtual machine. In this they might turn to be disadvantages for the migratingcase, the process of configuring the IDE itself to developer.work properly might be complicated requiringsome knowledge in the OS on which the IDE is 3. Affected Groupsran.

e) Some IDEs offer a visual composer for Two kinds of groups were affected by thebuilding GUIs. Though this will simplify the previously mentioned pitfalls:process of creating a GUI to a great extent by a) Developers trying to migrate from standard codegenerating most of the required code, some extra editors and loose set of tools to an IDE. In thiswork should be done by the programmer to case those developers will be generally interested"link" this GUI to the programmer's code. This in cutting the development time and having acould be not a straight forward process and powerful tool to edit, generate and test software.might add some extra burden to understand how In addition, developers would most probablyto make this link. would like to use some these IDEs advanced

f) Any programming language should have tools like the use of refactoring [7] which issyntax to abide by. Advanced editing features basically the process of changing code'sand automatic sentence completion will result structure without changing its behavior to makewriting most of this syntax on behalf of the it more maintainable [8]'.developer. This could either cause the developer b) Beginners trying to learn a new programmingto rely on such facilities to the extent that language using an IDE.program "logic" or "task" is lost or not being Writing object-oriented programs is complex.able to clearly identify what should be done by This complexity results from inheritance,the developer and what should be generated bythe tool. In addition, the code style generated by 1 Refer to Martin Fowler' s page on

Refactoring at www. refactoring. corn

Page 3: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

polymorphism, and the complex data interactions SDK: Standard Development Kit3 for this platformtied to their use [9]. Using an IDE could make doesn't come with any editor where the developerthings worst. The student will face the difficulty has the freedom to select his/her favorite one. Usingof the language itself in addition to that of the the standard tools, what are the pitfalls that theIDE. It is worth mentioning that many instructors developer might face in developing a Javahave laid some sort of "framework" to help application? (See Figure. 1)students to overcome the difficulties of learningobject oriented programming [10]. However,such frameworks do not address clearing the Editordifficulties embedded in learning how to use andwhat to use from an IDE. It is alwaysrecommended that beginners, having no or little Figure 1previous experience on OOP, should use thestandard tools found in SDK with the exception A hypothetcal example for some Java applcaThonofsign eitrithsyta (tkn clrn2, iS suggested for the purpJose of illustration. The

application will have a set of files including classes,4. IDE Features to Consider

interfaces, and a number of resource files (like imageand text files). The application uses a GUI that has anumber of different elements. It is again important to

Based on what have been discussed above, the two mention that we assume that the design of thisfollowing questions arise: application was reviewed carefully and it's merely

a) What are the bases of selecting a suitable the process of coding it that we are interested in.IDE and what features the developer should In the process of using some "Text Editor" toopt for in such a selection? generate the source files (java) the following might

b) How can the developer avoid falling into occur and requires more time and effort from theany one of the scenarios above and really developer:make use of the tool or IDE to boost hisproductivity? a) During editing, regular syntax and possible

run-time errors could take place. Also theJava, being widely used and having a great set of process of using a uniform coding styles and

features as an object oriented programming language coding conventions across the source files iscompared to C++ since the day of its invention [11], required.should have a decent IDE that will manifests its b) Independent edit/view of each of the sourcepower. files, corresponding to different modules.But before trying to answer the above two There is no easy way to see each object

questions, it should be clear that there is no substitute properties and methods, the relation betweenfor a basic understanding of how to write, compile an object, its ancestors and descendants,and run Java programs using the standard given tools. without going back to the source of each.This basic understanding is essential to be able to c) Coding the GUI requires considerableidentify the value and benefits added by such tools amount of time.and hence become able to determine what can be d) The proper placing of all the related sourceused to increase productivity. files with proper extension names (java).

5. Using the Standard Java Programming In the process of using the compiler "javac" theTools: following could happen:The most popular Sun Java platform, among a) Compiling and building these modules

others, is the J2SE: Java 2 Standard Edition. The requires clear idea about their dependencesin addition to their exact location in the

2 Like Notepad++ which is a free source code system.editor which supports several programming b) The generated class files, related to anlanguages running under the MS Windows application, should be placed in the properenvironment (See http://notepad- location.plus.sourceforge.net/uk/site.htm.)Or Arachnophilia, a freeware, supportingmultiple platforms since its written inJava (See 3 Seehttp: //www.arachnoid.com/arachnophilia/) http: //java.sun.com/downloads/index.html

Page 4: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

In the process of running the application using This is one of the most remarkable commercial IDEs"java" the following could happen: in the market. Though this is a very feature rich

a) Running the application requires knowledge environment having many advanced tools, it is by farabout the exact location of the related class suitable to be chosen as the first IDE to use by aor package files. developer. In addition, the system requirements to

b) The process of debugging in case of a run- run this IDE are relatively high. The "Developer"time error is not coherent across many version facilitates distributed development with newseparated files. Yet, debugging a GUI might code-level collaboration features such as sharedtake considerable time. editing and joint debugging.

c) The location of the additional resource filesused in this application must be known IntelliJ IDEA [15]:exactly. Moving the application into a This is another commercial IDE that can be used fordifferent location in the system requires the development of all Java dialects. The IDE has thecareful handling in order to keep correct best of all interactive code debugging and runningreferences to such files. compared to its rivals. One of the most noticeable

features is interactive variable checking during6. IDE Survey editing not to mention auto package imports. The

learning curve for this IDE is fairly acceptableMost of the IDE reviewed uses the "project" based especially with the included video tutorials that can

paradigm [12], [13], [14], [15], [16], [17]. As can be be found on the website. The down side of this IDE isseen from Figure.2 [18], the chart shows the the possibility of having the pitfalls (c) and (g)favorability of IDEs among developers. discussed in section 2 above (Common Pitfalls). InUnfortunately, the same cannot be said for addition, the price tag for this IDE is relatively high.developers just starting to use an IDE. A free 30-day trial version as well as special studentWe still believe that the time you spend trying to price is available.

edit, compile and run "Hello World" is a majorinstant factor for judging the suitability of this IDE NetBeans IDE [16]:for the developer. The developer "productivity" NetBeans is an open source project that is sponsoredshould increase as he/she become's more familiar by the creators of Java; namely Sun Micro Systems.with the IDE. Based on actual observations, it took Though it's free it not recommended for beginners atsome students a considerable deal of time just to be all since there are just too many configuration optionsable to run a simple "Hello World" applet on some of and the documentations are not that easy to digest.these IDEs. Some others failed to produce any The environment is better suited for developersoutput. With the exception of BlueJ, that has a visual targeting J2EE: Java 2 Enterprise Edition.module composition editor, the IDEs covered herefollow almost the same project based paradigm. BlueJ [17]:These include Eclipse, JBuilder, IntelliJ IDEA and The BlueJ environment was developed as part of aNetBeans. The following conclusions are obtained university research project about teaching object-for each of them: orientation to beginners. BlueJ is a free IDE where

the IDE itself is written in Java. Though simple andEclipse [13]: contains a visual designer for class/member relations,Eclipse is an open-source free IDE with the widest it does not follow the same trend of all other IDEs.base of users and the widest base of support forums, Also, it is somewhat feature limited. It doesn'tfree downloads and plug-ins. However, this support interactive debugging and lacks a GUIenvironment is not recommended as the first IDE to designer. Yet, it's an excellent tool if the aim is touse. In general, it needs a higher learning curve. The learn Java object oriented programming andIDE is not Java specific and thus, the menus and understand the object interaction mechanism.procedures are too generic and hard to grasp. It worthmentioning that there is a considerable amount ofwhite papers, documentation and tutorials about thisIDE. It could probably be the next step to choose.

JBuilder [14]:

Page 5: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

Figure.24_

7. IDEs and the Favorable Features

A suitable IDE should have a set of basic features ivithat will facilitate the process discussed in section 5in the most user-friendly and easy to use fashion. Figure.3This facilitation could be to a varying extent asoffered by different IDEs. Other features are extraand might be a pitfall for a beginner. It is by no Referencesmeans we suggest that such extra features should becompletely avoided; the aim is to gradually introduce [1] Lisa K. Ferrett and Jeff Offutt, An Empiricalthe developer to those basic features of an IDE where Comparison of Modularity of Procedural and Object-confidence can be built and gradually start using OrientedSoftware, 2002IEEE,Proceedingsofthe8ththose extra features. IEEE International Conference on Engineering of

It was concluded that a suitable IDE should Complex Computer Systems (ICECCS'02).basically provide five important features at minimum.These are: easy editing, visual GUI design, [2] Hee BengKuan Tan andWeihongLi, Systematicinteractive debugging, object/relations browsing, and Bridging the Gap between Requirements and 00interactive running (See Figure.3). In addition, Design,t2002 IEEE,Proceedings ofmthe 17tIEEEinstalling such IDE should require the minimum of International Conference on Automated Softwareuser intervention assuming the installation Engineering (ASE'02).requirements are fulfilled.The IDE should encompass all of those five [3] David Saff and Michael D. Ernst, Reducing

features shown in Figure.3 and make them easily wasted developmenttime via continuoustesting,accessible. The main difficulty of using an IDE is 2003 IEEE, Proceedings ofthe 14thInternationalbeing able to know how to go through the Symposium on Software Reliability Engineeringdevelopment process from it's beginning to its end (ISSRE'03).without too much setup or custom preparations. [4] Mykola Cherkaskyy and Abdulah Said Sadek.

The Levels of Program Complexity. TCSET 2004,February 24-28, 2004, Lviv-Slavsko, Ukraine, pp.396- 397

[5] Pablo Romero, Benedict du Boulay, Rudi Lutz,and Richard Cox. The Effect of Graphical andTextual Visualizations in Multi-RepresentationalDebugging Environments. 2003 IEEE, pp 236-238

[6]Lena Kallin Westin and Marie Nordstrom.Teaching 00 Concepts - A New Approach. 2004IEEE, 34th ASEE/IEEE Frontiers in EducationConference, pp. F3C-6 - F3C 1I

4 A modified more update version based on[18].

Page 6: [IEEE The 2nd International Conference on Distributed Frameworks for Multimedia Applications - Penang, Malaysia (2006.05.15-2006.05.17)] The 2nd International Conference on Distributed

[7] Mel 0 Cinneide, Automated Refactoring toIntroduce Design Patterns, ICSE 2000 LimerickIreland, pp. 722-724

[8] Michael Feathers, Before Clarity, IEEESOFTWARE, 2004 IEEE, pp. 86-88

[9] Roger T. Alexander, Improving the quality ofObject-Oriented Programs, IEEE SOFTWARE,Sep/Oct 2001, pp. 90-91

[10] Birgit Demuth and Lothar Schmitz, AFramework-Based Approach to Teaching OOT:Aims, Implementation, and Experience. Proceedingsof the 13th Conference on Software EngineeringEducation & Training table of contents, 2000 IEEE,pp. 283-294

[11] Arthur Van Hoff, The Case for Java as aProgramming Language, IEEE INTERNETCOMPUTING, Jan/Feb, 1997 IEEE, pp. 51-56

[12] Coleman, McCallister, Confino, Purcell,Koletzke and Shepard, "Java IDE Shootout Eclipse,Emacs, IDEA, JDeveloper, NetBeans software. 2004JavaOne Conference - Session 2864, pp. 1-51

[13] Eclipse, open-source IDE,http://www.eclipse.o

[14] JBuilder, commercial IDE,www.borland.com/us/products/jbuilder/index.htmI

[15] IntelliJ IDEA, commercial IDE.www.j etbrains.com/idea/

[16] NetBeans, open-source IDE,http://www.netbeans.org/

[17] BlueJ, freeware IDE,http://www.blu /

[18] QA Systems IDE Usage Survey, 2003,www.ga-systems.com