Useful Stuffs

Tools in Java 


---July 11th---

Advantages of Object Oriented Programming over Procedural programming

     1. Memory management- OOPS used to manage the memory resources by itself where as Procedural programming doesn't.

    2. OOPS supports inheritance.

    3. OOPS has the concept of Encapsulation and Polymorphism.

    4. Reusability of  code in OOPS.

    5. Easy to develop/understand and maintain the code incase of OOPS.

Important things that are considered to develop a new programming language:

1. Variables
2. Keywords
3. Syntax
4. Conditionals
5. Loops
6.Inbuilt functions
7. Exception handling
8. Garbage collector

---July 8th--- 

Documentation

     Documentation of a project is the most important consideration in the phases of Software Development Cycle. The documentation is very helpful in case of upgrading a software as well as in its Maintenance and Support.

   Importance of Documentation:
  • The maintenance of a project becomes worse if there is no proper documentation as the years pass by.
  • The person who fails to document his own project might not understand his own lines of logic.
  • Since the author of the code can leave the project in the hands of another s/w professional, the documentation becomes mandatory.
  • The requirements of the problem can be well understood even after years, if the documentation provided is proper.
  Steps that are to be followed while documentation:

   The following are the parts that has to be considered while documenting a Class as well as a method. 
  • Author name.
  • Problem Statement/Logic used in the class or method.
  • Input that are to be provided along with the return type of the i/p.
  • Output that is expected along with the return type of the o/p.
  • Exceptions that may arise.
  • Logic /Actual code.
  • Wherever necessary, comments can be given for understanding the complex steps in the lines of code. 
---July 18th---

       Things to be considered while designing a database
  • The number of columns in the table must be reduced as much as can.
  • The database must allow future enhancement i.e. any additional data required can be added without much difficulties.
  • Instead of adding more columns, it is advisable to have more number of  tables ( even that too for a particular extent, since time for referring more no.of tables equals referring more no.of columns).
  • In a developer's perspective, the database must be simple enough in order to make the coding simple. By doing so, the future changes might not have more effect on the code.
---Sep 19th---


Tools in Java
     
     There are multiple tools in java which makes the programmer's work easier in documenting the code, archiving the application, versioning and so on. The following are some of the tools present in java. 
  • javadoc
  • jar
  • extcheck
  • HtmlConvertor
     javadoc
     Javadoc tool is for easy documentation of the java code that you did. This tool automatically creates the document similar to the java documentation comprising of several features such as Constructor Summary, Method summary,interfaces, parameter list and comments that you have given inside your code. Thus the doc comments present in the code are converted into html format easily. 
     This tool we be available in the bin directory i.e Java\jdk1.6.0_14\bin.
  
     We can also create java documentation from the command line by using the command as follows:
     javadoc *.java           ---> If you want to create whole documentation
     javadoc example.class --> If you want to create doc for only specific class.

     jar 

     The jar tool in java is useful in bundling the class files that you wrote for a java application. Its something similar to zip format except that it contains the class files in a single Java Archive file. With use of jar tool we can create a jar file, update a jar file and even we can run the application inside the jar file with the help of manifest file that is automatically created when jar file is created. 
     This manifest file inside the Meta-Inf folder of the jar file contains the Path which is to be taken as the entry point and hence the reason we can run the program easily with jar tool. 

     To create a jar file the command is as follows:
     jar cf jarfilename.jar *.class
     Here c indicates that you are going to create a java archive file in the name as indicated before .jar. This will work only if f follows c. Otherwise jar file will be created to the standard output. 
     
     Incase you want to update the jar files you can use the following command:
     jar uf jarfilename.jar input-file
     Here input-file is the file that has to be updated. If the file with same name already exists in jar, then the older one be rewritten. Otherwise new file will be created in the jar file.
    To extract a jar file:

    jar xf jarfilename.jar will extract the specified file if input-files given, otherwise it will extract all the files and directories. 

    extcheck
     The extcheck utility is useful in detecting the versioning conflicts between target jar file and the currently installed extension jar files.
    The extcheck utility compares the Specification-title and Specification-version headers in the manifest of targetfile.jar file against the corresponding headers in all Jar files currently installed in the extension directory.
     Before installing an extension, you can use this utility to see if the same or a more recent version of the extension is already installed.

     Html Convertor 
     The HtmlConvertor tool is used to convert the html page containing java applets into java-plugin format. 
     With the HtmlConvertor tool, the html code up to applet tag is first converted to a temporary file and when the applet tag is reached it is converted into java-plugin format.