Wednesday, February 03, 2010

And yet another great idea.. that turns out to be an old one.

Before, I had these ideas before:

1- The first idea is already there now, it’s the Spring OSGi Server.
2- The second idea is, as I read once, already implemented by Google now, you upload a picture of something and search for this place, it gets you more information about the place and what is it and stuff like this. But the only difference is that Google’s implementation is for known landscapes and sights. I mean something like the Pizza Tower, Pyramids, etc.

Today, while I was reading JavaLobby, I stumbled upon this article about Fork-Join programming in Java. I didn’t know what fork-join means, so I opened the URL here.
Which turned to be an idea that I had about a year ago:

Why can’t we have a way in Java that would let us execute a method implementation in a way that is not serial, but parallel with defining dependency between the code.
For example:

public void someMethod() {
String s = “something”; //variable declaration 1
Method1(); //do not depend on variable s
Method2(s);// depends on variable s
Method3(); //depends on method1

- Now, let’s assume the previous code, method 1 doesn’t depend on variable s and can be launched in separate thread.
- Method 2, depends on variable s; but it doesn’t depend on method 1. Method 3 must be executed after method1

The idea is simply to use some way to define method1 with no dependency, so one of the processors can execute it first thing (with same priority as variable declaration).
And then a way to have method2 depends on variable declaration. That means that method2 must be in queue to variable declaration. It can only start after variable declaration is finished.
And a way to have method3 depends on method1. Well, I guess you got the idea. Of course, we can have one line of code depends on many other lines.

The idea I had was generally and basically based on a way to define the dependencies between code lines and execute them in different threads. I know, I know.. not so fancy implementation with lots and lots of issues and concerns.

Now, back to fork-join development in Java and this article: First of all, I did not know that there is a name for this approach. And I sure didn’t know that there is a JSR for it Java (JSR 166).

I’m really happy that, although I didn’t study computer science, I have such ideas. It means, I’m thinking.. :-D
But, also, it means I need to study computer science before thinking about something else. :-(

Saturday, June 06, 2009

Java EE technologies list

Today, and finally, Sun decided to post a list of all technologies used in the Java EE along with its specifications' URLs and versions. I am really glad that they finally did that.

Latest Java EE release with its technologies and specifications numbers is here (for the time of this post, it is Java EE 5).
For the time of this post, Java EE 6 technologies preview page.

To know why I am really happy with this list, check this link here for Java EE 5 technology.

Saturday, May 30, 2009

"JDK 7 and languages changes" needs a pause

Today I was reading about JDK 7 and the new language changes and I stumbled upon this InfoQ post. But what really grapped my attention is in the first reply to the post, here: 'Funny thing about Java, it's "what you can ADD to it" culture.', Vic C said

Few minutes earlier I was reading Alex Miller - Java 7 page and was thinking to myself the same, but in the good way.

My point is:
We have been adding, looking to add, and already added lots and lots of features to the language itself and yet keeping the backward compatibility. That's a hell of a work, I must say. It's very difficult to maintain that, for sure. Sun has been doing lots of good job.

But what about the new java developers? What about the old java developers?

Old Java developers would be having to learn more and more about the language and how it works and how to use it and its features. I do not complain about learning new things, but, it's the amount of knowledge that we; old java developers; need to learn. It's so huge and getting bigger everyday.
But the only thing that makes me able to continue is that I am building over what I already have learned. It's accumulative. That's what makes it, for me at least, a little bit easy.
But I have seen some developers who does not read articles online daily and does not keep up with what's new.
Believe me, they are facing a tough time trying to catch up now.

And what about new ones? Imagine the amount of knowledge they need to learn. Imagine how much info, starting from OO concepts, variables and what they mean, and ending with..... mmmm... is there really an end? I can't see it. I have been in the area for over than 6 years now, and since I started and there are always lots of things new to learn, and that's exactly what keeps it interesting.. ;)

It's very good that we have what we have now. But instead of the current roadmap we have for the Java SE which is simply add-more; we need to have the current roadmap:
1- Stop adding new features and adding new language changes for a while.
2- Remove all things that are just kept for backward compatibility. At least incrementaly on two versions.
3- Release more two versions of Java SE that would only be having bug fixes resulted from the previous step, step 2. Which I presume will be a lot.
4- With a much more cleaner, simpler, smaller version of Java resulted from the previous 3 steps, we can go on with adding more stuff to the language.

I know that JDK 7 is almost done. So, what I am saying should be after JDK 7.

1- Java will be easier to learn.
2- Java will be more robust.
3- JDK will be smaller
4- New developers will be learning easily
5- Old developer will have a chance to grasp the current changes made to the language. We need a pause to grasp. (I am talking about language changes, not JDK features.. ;) )
6- We will be having another chance for going to the 'add-more' stage after taking a deep breath.
7- JDK community will have a chance to really think of the new "required" changes to be added after that.

JDK is not just a product that needs a new release every year with new features and changes. It's a 'platform' that lots of products are built-on. It needs to move with major changes slower.

Tuesday, August 26, 2008

Today, I was surfing the net and reading some articles. I read a comment about something that mentioned the Java based OS; JNode.. WOW...
Finally.. I am very happy for it. Very happy more than any one can ever know.

Last year I was thinking why not having a Java based OS. Imagine you can just simply write Java code and save it locally and then type a command to compile it (i.e., compile and to run it, just type: MyFile
Any way,.. this is not the case. But it still could be done.
I really like it very much... :)

I was thinking of such an idea by eliminating the entire native part and moving the JDK to be part of the processor or something. That was in my previous (old) blog entry I had.

Well, of course, it had a lot of troubles for having the native related stuff moved to the processor as mentioned in the comment. But any way.. it was just an idea.

Still, I am very happy for the JNode project. I wish it would make it to the public and be a well known OS. Best of luck.. :)

Tuesday, July 15, 2008

And I have another crazy idea...

It's been a while now since I had this small idea in my head. Some people may thing that I am crazy...
But what the heck.. all brilliant ideas and thoughts were considered to be crazy at its early stages :)

Imagine that you can go to your favorite search engine, Google for example, and you go find the following options
1- Web (text search) - which already there and the default
2- Images (based on text search) - which is already there an accessed when you click on Images
3- By image (which the idea I have).

The idea is very simple:
You upload an image you have, and then click search.
- The search result?
It will be any URL or page that contains or references the same image.
- Why?
1. Cause I cannot remember how many times I saw a picture of something and do not know what is it and wanted badly to know.
2. Cause I cannot remember how many times I saw a picture of someone/something and I was hundred percent positive that I saw it before somewhere on the web but I cannot remember where.
3. Cause you may have a picture of someone you know and have not seen him for a while. One of the options to find him would be using his picture (names may change or not be used).
4- It is still a good idea.. :)

Well, I know that such a search engine would take a lot of time doing processing (I have seen it in the movies with specific comparison points of the face - US Police and FBI search for criminals).

It is implemented, and it is there.
It is heavy a processing search. I know all of this.
But still, why not having it public like text based search...?

Well, it is a crazy idea.. :)

Distributing a Java Application via CD-ROM - Why?

Today, I was checking web page. I read the article of Distributing a Java Web Start Application via CD-ROM

Well, that is my initial thinking of its possible usage scenarios:
1- It could be used for installation CDs
2- It could be used for making a demo CD with and embedded server (Tomcat or Glassfish) and the application deployed to it. And having this CD sent to the client
3- It could be used for making an auto-update CD for an already deployed application (sending the application update on a CD to the client which all he has to do is to insert it into the CD-Rom and it would update the already deployed application).

Sunday, July 06, 2008

First time to Maven

Today, I was navigating website. I ran into the Cocoon project. Out of curiosity, I opened it. I know the project 5 years ago and I thought that it was closed (obsolete). I don't know why I always had this thought in mind, but any way. I was really amazed that the project is still open and still has activities (latest as the time of this writing is: Cocoon 2.2.0 Released on 5/15/08

Any way, while reading the documentation (Your first Cocoon application using Maven 2); I ran across this link: Maven in 5 Minutes Which lead to this link: Maven installation instructions
It's been a while since I wanted to run maven and get used to it. So, I started downloading Maven 2.0.9 immediately and began the installation instructions.
After that I went back to the Maven in 5 Minutes which made me confused about two things:
1- In the "Creating a project" section, there is the following comment:
"If you have just installed Maven, it may take a while on the first run. This is because Maven is downloading the most recent artifacts (plugin jars and other files) into your local repository. You may also need to execute the command a couple of times before it succeeds. This is because the remote server may time out before your downloads are complete. Don't worry, there are ways to fix that."
2- I created the project any way, and continued to building it. Now although the previous mentioned comment, and although I find it very strange to go through downloading all these JARs in the creation phase, it started to download the JARs again to build the project..!!

I think that it should not have downloaded extra JARs in the first place, and I think that it should not have downloaded them again.
I did not try it; but I am afraid of having to download all the JARs every time I try to build the project.
I think that this is nonsense. If Maven is requiring these JARs, I think it should be available in the downloaded file itself, if not, it would be downloaded once and for all. Or may be, added by the user himself into the lib folder or something.

Any way,...
That was just a try. May be I would explore about this more or explore the documentation section later..

Now, I'll get back to the new Cocoon.. ;)

Wednesday, June 04, 2008

Eclipse IDE Introduction

The Eclipse IDE is a very rich and easy to use. But; as a senior developer who have been all the time in contact with, and sometimes giving courses to junior developers; I found out that with the following introduction about Eclipse, I help them to have a faster startup time. So, I thought of sharing this quick introduction of Eclipse IDE to everyone.

This introduction will not be including any screenshots of Eclipse.
But it will only introduce what is Eclipse, how is it organized, and how to look at it as a tool for helping us writing code.

Eclipse is an Integrated Development Environment (IDE) that contains a set of tools to help an application developer building his application.

How Eclipse is organized? To answer this question; let’s have a quick look at any Enterprise Java Application and what is its main components.

Any Enterprise Java Application (EAR); and let’s take it from the widest perspective; is an application that may contains some Web Applications (WARs), may contain some Enterprise Java Beans (EJB JARs) and may contain some utility JARs.
Also, the application, from the business point of view, may contain web application, some business logic, and a data model.
The data model could be Database or XMLs ruled by XSDs or DTDs, and could be both.
Of course, your EAR would require a server to run on. And of course the server will generate some output to the console.
Having all of these in mind, we find ourselves expecting to have too many tools to help developing such an application or simply, no tools at all. Eclipse IDE, provides too many default tools (plug-ins) that are downloaded together as a bundle and also supports adding more tools (plug-ins) to the downloaded bundle. You can even create your own.

Back to our question: How Eclipse is organized?
Now, as a developer, you would be having a task assigned to you. This task could be only related to JSPs and Servlets, or could only be related to EJBs. Eclipse IDE provides something that is called "Perspective".
The perspective is the way you are looking to your application at the moment. Are you looking at it from the web components side, EJB components side, or may be from the configurations side (XMLs and XSDs). Imagine the application as a car. You need to check something at the inside of the car; you would go to the inside-perspective. To check your car’s breaking lights; you would go to the rear-perspective. And so on.
For each side (perspective) you are looking to your application, you would find the common tools that are used for that perspective of the application. For web perspective, you will find the set of tools that are focusing on editing JSPs and Servlets and putting their configurations.
For the XML perspective, you would find the XML and XSD editors in hand providing you with a GUI for editing these files.
For the Java perspective, you would find the tools to inspect Java files and edit them. For the database perspective, you would find the tools needed to connect to a database and another tool for browsing the database tables. And another tool for writting and executing SQL statements.

For each perspective, you’ll find the right tools. These tools are called views. Some views are used for editing, some are used for only viewing properties, and some are used to view output.

Of course, for each perspective, the set of tools that appears are the default commonly used tools for that perspective. You can customize that perspective and add more tools (views) to your perspective and even you can customize your current perspective and save it for having it as one of the default perspectives for that workspace.

Well, that's it.
Looking at Eclipse this way, makes it much easier to use. At least that's what my colleagues told me.