One of the most common questions asked by individuals who are starting programming is “from where do I start?“. Unfortunately, just mastering the language is not enough. A developer also needs to know other things such as:
We will briefly discuss each part. We will use the car engine (Wiki) and the car engine engineer (Wiki) as an analogy to help you understand better. Engines are fixed by a mechanics. Not everyone is a mechanic and not every mechanic can fix any type of engine. The mechanic needs to be trained to fix a specific type (or brand) of engine. For example a car mechanic may not know how to fix a marine engine even though these are very similar. Secondly a mechanic needs tools to fix an engine. These tools are integral part of the mechanic job and cannot work without these tools. Furthermore, the mechanic needs to know how to use these tools well in order to makes the best use of their investment. Finally a mechanic needs to buy replacement parts from a distributor or an agent. These parts are then used when fixing the engine or performing other work. Now let us see how this fits in the programming world.
Every developer needs to know the language they are programming with. The developer needs to know the language syntax together with what should be done and what should be avoided when programing with that language. One needs to know the strengths and weaknesses of the language being used. Two languages that are said to be object oriented may be very different in their mechanics and what applies to one may not necessarily apply to another. Java (Homepage) and C++ (Wiki) are two good examples of this. Both languages are said to be object oriented, but these two languages are very different. Java is managed language (Wiki) while C++ is not and this plays a big role when working with these languages.
The code needs to be written by a developer, or a programmer. The code is written in a text file which is then compiled by the Java compiler in case of Java. In the old days we used Notepad++ (Homepage) or other light text editors and then compiled the code manually. Nowadays we have IDEs, such as SpringSource Tool Suite (Download page), which provides many useful features. The IDE plays an important role as it can help us be more productive when used well.
Finally the developer will use existing code, or libraries as sometimes these are referred to, when developing. The Apache Commons Lang library (Homepage) is a good example of this. This is a popular library that provides many useful functions used by many developers around the world.
The first thing to do is to setup the environment as described in the page titled: Getting Started. In this page you see what needs to be installed and how to use the code found in this website. Then you can try out the examples available in this website as described next.
Most of the articles found in this website also have examples, which you can download and try on your computer. We will use the Simple Gson Example project as an example.
Right click on the Simple Gson Example (arrow ) and select Checkout… (arrow ) as shown in the following image.
This will open the new project dialog as shown next.
Just click Finish to download the project. Once ready, switch perspective to Spring (or Java).
Here you will see all code that the article discusses. In each project there may be other code which the article does not refer to such as other examples or tests cases.
main()method and thus these classes cannot be executed. You will need to find a class that has the
Open the SimpleExample1.java (arrow ) by double clicking on it as shown in the following figure.
Note that this class has a
main() method, therefore we can execute it (arrow ). Press the run button (arro3 ) to execute this class. This program simply writes some text to the command output as shown below.
As you saw, checking out an existing project is very straight forward and running the examples is not a difficult task. You can modify the examples as you like and experiment with them as much as you want. Note that your changes will not affect the repository as you can only read files from it.