Posts Tagged 'java'
Java
Java () is an island of Indonesia. With a population of 135 million (excluding the 3.6 million on the island of Madura which is administered as part of the provinces of Java), Java is the world's most populous island, and one of the most densely-populated places on the globe. [http://en.wikipedia.org/wiki/Java]
- Details
-
Category: News
-
Published on Monday, 12 December 2005 00:00
-
Written by Administrator
-
Hits: 6911
Blogg-X is also using my captcha framework for Joomla.... :-)
- Blogg-X is a cross platform (Mac OS X and Windows XP) blogging and content management tool for websites based on the Joomla! CMS. With it's built in WYSIWYG editor it allows rich content to be posted onto the front page of your Joomla! site eliminating the need for the internet browser and being logged in. Now also allowing easy updates to already posted content and post deletion. If you want to post content quickly and easily Blogg-X is for you. When combined with AkoCommentPlus from Walter Cedric you have a complete, fast, simple and spam free front page blogging solution for Joomla!
Articles tagged
-
-
- Details
-
Category: Framework
-
Published on Tuesday, 31 August 2004 00:00
-
Written by Administrator
-
Hits: 13132
In computer programming, a unit test is a method of testing the correctness of a particular module of source code. The idea is to write test cases for every non-trivial function or method in the module so that each test case is separate from the others if possible.
Articles tagged
Read more: Apache Junit
- Details
-
Category: Tools
-
Published on Monday, 22 November 2004 00:00
-
Written by Administrator
-
Hits: 8999
"
For more than 50 years software
has been a troublesome discipline. Software's problems are numerous and
include cancelations, litigation, cost overruns, schedule overruns,
high maintenance costs, and low levels of user satisfaction. The
problems with software occur more often than not. My company's research
indicates that more than half of large software projects will encounter
some kind of delay, overrun, or failure to perform when deployed. But
software does not have to be as troublesome as it has been. Articles tagged
Read more: Metrics and Models in Software Quality Engineering book - Adisson Westley
- Details
-
Category: Design Patterns Behavioral patterns
-
Published on Thursday, 20 January 2005 00:00
-
Written by Administrator
-
Hits: 7136
Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.

Source code
/**
* Knows its observers. Any number of Observer objects
* may observe a subject. Provides an interface for attaching
* and detaching Observer objects.
* @role __Subject
*/
public class Subject {
private ArrayList observers = new ArrayList(); public void attach(Observer observer) {
observers.add(observer); }
public void detach(Observer observer) {
int idx = observers.indexOf(observer); if (idx != -1) {
observers.remove(idx); }
}
protected void notifyObservers() {
Iterator it = observers.iterator(); while (it.hasNext()) {
((Observer) it.next()).update(this); }
}
}
/**
* Defines an updating interface for objects that
* should be notified of changes in a subject.
* @role __Observer
*/
public interface Observer {
/**
* Update method.
*/
public void update(Subject subject);}
/**
* Stores state of interest to ConcreteObserver objects.
* Sends a notification to its observers when its state changes.
*/
public class ConcreteSubject extends Subject {
// add your subject's specific stuff here
}
/**
* Implements the Observer updating interface to keep
* its state consistent with the subject's.
*/
public class ConcreteObserver implements Observer {
public void update(Subject subject) {
// put your code here
}
}
Articles tagged
-
-
- Details
-
Category: JAVA tools
-
Published on Wednesday, 09 March 2005 00:00
-
Written by Administrator
-
Hits: 10044
Maybe You do not know or have ever heard that there can be an alternative to notepad, wordpad, textedit, ultraedit, textpad ...and the list of text editor can be very long. I am using JEDIT since 4 years now and will never give it back. It is one of these Java application which demonstrate the portability and quality of Java software. (Mac OS X, OS/2, Unix/Linux, VMS and Windows)
Open source, GNU General Public License, 7 years of development: jEdit is a mature and well-designed multi purpose text editor. Feature list here
Articles tagged
-
-
- Details
-
Category: Eclipse
-
Published on Friday, 26 September 2008 00:00
-
Written by Administrator
-
Hits: 13311
| Here is the list of all 380 default shortcuts keys for eclipse Ganymede in an easy to print layout (4 pages A4). I recommend you to print a booklet out of it. Nobody on Internet is currently providing such a list, except a sourceforge project but their keys binding is for eclipse 2.1,Others keys binding for eclipse will follows soon. |
3rd party plugin shortcuts:
Download as PDF now eclipse.ganymede.shortcuts.keys.binding.pdf
- Details
-
Category: Technical
-
Published on Thursday, 27 August 2009 00:00
-
Written by Administrator
-
Hits: 20699
Short description of how to accomplish some specific task in Debian Lenny.
- How to install Sun java 1.6 on Debian Lenny
- How to install Tomcat 6.x on Debian Lenny
- How to install MySQL on Debian Lenny
Read more: Debian Lenny how to
- Details
-
Category: Apache Maven
-
Published on Tuesday, 07 June 2011 19:29
-
Written by Administrator
-
Hits: 3065

The Maven Dependency Plugin among other things include a dependency:analyze-duplicate
The dependency plugin provides the capability to manipulate artifacts. It can copy and/or unpack artifacts from local or remote repositories to a specified location.
This Apache Maven plugin is really feature rich and provide a lot of interesting goals:
Read more: List conflicting dependencies in the Maven reactor
- Details
-
Category: Coding
-
Published on Tuesday, 31 August 2004 00:00
-
Written by Administrator
-
Hits: 8483
Â
Java Coding guidelines
I won't give you here all explanations on how to improve your code, only some references to external ressources, a lot of people have done a good job (hard work, respect!). Feel the need to improve your code, and you will follow more or less the same road
Kent Beck often makes a statement about himself, "I'm not a great programmer; I'm just a good programmer with great habits."
"keep it small to keep it beautiful" me speaking about refactoring ;-)
"Tests don't prove the absence of bugs"
"Good judgment comes from experience. Unfortunately, the experience usually comes from bad judgment"
Occam's razor (14th century philosopher monk): No complexity beyond what is necessary.

Things you may do to improve your code
- Respect the Java guidelines, a lot of white papers can be found on internet.
- Never return a collection (Vector or Hashtable or) in java, prefer to return a class which hide the real collection, better return an interface, this will allow to refactor the code if performances issues are found. Difficulty is of course to define a good contract between your code and client which will use it (good interface). Never use a Vector and let the client cast or extract Object type, let the compiler protect yourself against runtime error!!!!
- If you need to have diffferent implementation of a class, but do not want to have one of them in memory (for example because of costly licences), you need a dynamical factory (Abstract polymorphical factory) Here is a templates of this ZIP file
- Use idea of design from open source project! a lot of great and skilled people are working for the fundation Apache for example.
- Use Object development (of course) but do not rely on interface shipped with 3rd party objects you are buying/integrating, always create a wrapper around them or better define your own interface, use a strategy pattern....
- A good code is a small code! responsabilities must be properly localized (do not be lazy, create more objects!) and not spread around or worse localized in one object (spaghetti code). Naming convention is very important! you can distinguish an orange from an apple? right so do not forget that the easiest refactoring methods are: rename methods, rename variables, rename objects, rename packages, move code to...
- Use a logging framework or better use nothing else than log4j or any implementation based on it. It is a great advantage to know how many bugs or errors has occured in production and when. Moreover changing debug level without rebooting server, or changing output destination are neat features FAQ.
- Feel the need to avoid comments! they are not really synchronized (some people prefer to say NEVER synchronized) with the source code. If you still need comments, ask yourself if you can not use these comments to rename or reorganize the code they belongs. You may only explain: designs patterns used, bugs corrected (prefer to write a Junit testcase), algorithms or hacks (hacks are temporary solutions that do not create any major problems).
- Do a daily integration, this is quite simple with eclipse and if you use ANT, read more at http://www.martinfowler.com/articles/continuousIntegration.html
- Use XML! yes it is memory consuming, slow to read (not always) but it has a so much advantages that they can not be listed here (or not now),
- Prefer lossely coupled system or process, for example try to create a meta descriptions data storage if you have a lot of layers in your system or use webservices
Optimizations:
Of course some habits of coding are really bad, but nearly all compilers are catching them, and can do some agressive optimizations... you will never thinks of, moreover some JVM can optimized the bytecode on the fly (HOTSPOT) or do second pass during compile time. Do you really think that you will speed up your program when you take care of writing rules or try to use a non readable algorithm which contains a lot of tricks? if you do so, you will not see the evil loop where your system will hang for seconds....Keep always in minds:
- Do not try to start any optimizations too early, code must be readable and high level.
- Use a profiler, if you are not satisfied with performances! and locate precisely the place where you loose time or eat memory. Memory leaks can be found with profilers too (yes memroy leaks are existing in java :-) ). This can be done by a core taskforce team, generally in one/two week(s).
- Remember that when you will ship your code to customers, new cpu or machines will be available, chance is that a better cpu will cost less than hours of optimizations.
- Techniques to improves performances are well documented, and quite easy. I use generally: pooling, load balancing, caching, precomputing values (you remember people using sinus table accurate at 10-3 for demo on amiga or HP48?), some patterns are helpful too, lazy evaluations, lazy initialization, delayed constructions! and so on...It is like a new world!
- If you use a storage system, like a database, you can use an external ressource to improve IO, turn on the SQL query analyzer in SQL or Oracle to see what is going on. Any DBA (Database Administrator) can determine really fast where problems are: no index, bad design, foreign keys not well choosen, too much or bad join of tables, tables are too big, temporary table not empty after use, not enough virtual memory tuning, no cache tuning, bad JDBC-ODBC driver....
- JVM parameters tuning: after using the profiler, you can determine the optimal size of heap and stack, turn hotspot on or cut it off because sometimes it has some bad effects.
- User determine if a system is slow, or after loading the applications you can decide to improve your code if needed (memory used, cpu used, io used ...). Remember end users are humans (not always ;-) for me), you can disturb them or make the wait look shorter if you use a hourglass or vertical slider, system must be responsive to user interactions! display something but do not hangs during seconds. A small javascript code can give you 40% more "hanging" time with great users acceptance
Things you may read to improve your code
- Read news about java technologies: www.javaworld.com, project hosted at www.soundforge.net and so on. You must keep yourself inform about the latest state of the art.
- Register at http://developer.java.sun.com/developer/ a lot of great forums, and a knowledge database can be freely browsed.
- Refactoring: a change made to the internal structure of software to make it easier to understand and cheaper to modify without changing its observable behavior. (from Martin Fawler's book: Refactoring)
www.refactoring.com and techniques associated.
My own definition would be: never be satisfied with your code! when it works and has been tested, write JUnit testcases and take 10 min to refactore your code each day. The book above has a good introduction about why it is important and how you can explain it to your manager. read one refactoring technique per day, it will also help you to improve your code. - AntiPattern: "An AntiPattern is a literary form that describes a commonly occurring solution to a problem that generates decidedly negative consequences.
- AntiPatterns are a method for efficiently mapping a general situation to a specific class of solutions.
- AntiPatterns provide real-world experience in recognizing recurring problems in the software industry and provide a detailed remedy for the most common predicaments.
- AntiPatterns provide a common vocabulary for identifying problems and discussing solutions.
- AntiPatterns support the holistic resolution of conflicts, utilizing organizational resources at several levels, where possible.
- AntiPatterns provide stress release in the form of shared misery for the most common pitfalls in the software industry" from
Reference book is AntiPatterns Refactoring Software, Architectures, and Projects in Crisis
William J. Brown - Raphael C. Malveau - Hays W. McCormick III - Thomas J. Mowbray - John Wiley & Sons, Inc.
- www.extremeprogramming.com follow this rules to respect deadlines and work in an ambitious project.
- www.objectsbydesign.com use patterns in your projects! and use comments saying which one you are using and why.It help a lot to understand the code.
- www.bruceeckel.com and his famous free book "Thinking in Java" is a must for all developer (entry level but sometimes it is good not to forget basics of languages or OO)
- Checked exceptions are not supported in Java but can be implemented, read here: http://www.mindview.net/Etc/Discussions/CheckedExceptions
- Read cocomo in order to know what can make sense, statistics released by an university in USA that show influence of parameters during a project: what does a guru bring to a project?...what are the cost of a reatime application? how do I determine how long it will take?
- Details
-
Category: Framework
-
Published on Tuesday, 31 August 2004 00:00
-
Written by Administrator
-
Hits: 10950
Â

Work in progress