Tuesday, January 29, 2013

Development Tips :: Responsibilities for Senior Java Developer

Senior Java Developer Responsibilities

A senior Java developer is responsible for developing applications using the Java programming language. A developer in this position is also responsible for overseeing the execution of software development from the conceptual phase to the testing phase. Because this is a senior level position, he may also be responsible for mentoring junior developers as well as working with customers and handling research groups.

Read more: Senior Java Developer Job Description | eHow.com http://www.ehow.com/about_6601671_senior-java-developer-job-description.html#ixzz2JLvCcnbV


I don't think there is an agreement over the job description for the Senior Developer, you can see that a company in Toronto asks for the following:

  • At least 10 year experience in high availability software and system implementation based on J2EE architecture and design patterns
  • Must have experience with asynchronous communications and networks protocols and concepts
  • Oracle 9i or 10g
  • Ant Scripting or Maven
  • Experience with PKI and Security concepts
  • Excellent communication skills
  • Team player and willing to mentor junior developers
  • Process oriented
  • Worked previously in structured environment where process has been followed and respected.

While in New York they asks for the following:

  • - 5+ years experience in J2EE Development 
  • - 3+ years designing UI and J2EE applications
  • - Understanding of standard J2EE UI patterns
  • - Must be able to work off hours when necessary to support production jobs or resolve production issues
While in Sofia,Bulgaria:
  • Software developer with more than 3 years commercial experience
  • Deep knowledge in JAVA technology and OOP principles
  • Understanding and experience with basic design patterns and reusable software design approaches
  • Experience with SWT
  • Excellent communication skills and fluent in English
  • GUI design skills in an IDE context
While in India:
  • Education: (UG –B.Tech/B.E Any Graduate - Any Specialization) AND (PG –Post Graduation Not Required). 
  • Experience: 3-6 years
While in Sydney:
  • 8+ years of overall experience. 
  • Experience with XML, XSLT XPath, and XQuery. 
  • Experience with Spring and Hibernate or IBatis as ORM.
  • Understanding of EDI. 
  • Abilities to drive complex technical design across system domain boundaries. 
  • Experience developing and architecting object-orientated applications using one or more of the following programming languages: J2EE, Spring WebLogic/WebSphere, Application server, Oracle (SQL-PL/SQL). 
  • Demonstrated proficiency in designing distributed applications in which multiple operating systems, languages, and vendor middleware interoperate.
I think that years of experience can't reflect the real experience of the person, yes off course the senior developer should have a years of work experience to say he is a senior but I think 1 year of experience for a developer is better than 3 years for another.

Adding special technologies like knowing Hibernate for example as a condition for recruitment is nonsense from my opinion, as a developer i think i could develop any kind of technology if I have the concept with experience in other related technologies.

Have a nice day.

Monday, January 28, 2013

Java :: String Builder VS String Buffer

String Builder VS String Buffer

StringBuffer is synchronized, StringBuilder is not, So off course string builder is faster.

And applying the following example using i7 processor and 8 GB ram:


public static void main(String args[]) {
long startTime = System.currentTimeMillis();
//StringBuffer concat = new StringBuffer();
StringBuilder concat = new StringBuilder();
for (int i = 0; i < 1000000; i++) {
concat.append(i);
}
long endTime = System.currentTimeMillis();
System.out.print("length: " + concat.length());
System.out.println(" time: " + (endTime - startTime));
}

will returns the following:

Using String Builder 47 Milliseconds.
Using String Buffer  57 Milliseconds.

Soooo, why to use the "String Buffer"??

as mentioned string buffer is synchronized, and that's means what???
It means that string buffer during appending will have to do a new task which is checking and making sure that only one instance is appending to the buffer at the same exact moment, so if you felt that your system will face that case -appending at the same time- you SHOULD use string buffer.

Have a blessed day :)

Sunday, January 27, 2013

Database Naming Convention



Oracle Schema Naming Standards

The following standards will be used in all schemas:
  • Schema objects - All non-table schema objects will be prefixed by their type and all index names will begin with idx, and all constraint names will begin with cons.
     
  • Referential Integrity conventions - All tables will have full RI, including PK constraints, FK constraints and check constraints. The default for foreign key constraints will be "On Delete Restrict", unless otherwise specified.  This means that no parent record can be deleted if there are corresponding child records.
     
  • Primary keys - Oracle Sequences will be used to generate unique row identifiers and all sequence numbers generally will start at one and increment by one.
     
  • Check Constraints - Lists of valid values will be used in all cases to restrict column values and validity

Oracle table naming Standards

To simplify development, we will follow these rules that allow the developer to quickly identify each metadata object, with complete descriptive names:
  • Table Standards
     
    • All table names will be plural (e.g. users vs. user).
    • Full table names will be used whenever possible.
    • If a table name should exceed 30 characters, reduce the size of the table name in this order:
      • From the left of the table name, remove vowels from each word in the table name except for the first vowel of each word.
      •  If the table name is still greater than 30 characters, use standardized shorthand indicators. Record this standard for consistent use.
         

Oracle column naming Standards

  • Column Naming Standards
    • Column names should be spelled out whenever possible.
    • If a column name should exceed 30 characters, reduce the size of the column name in this order:
      • From the left of the column name, remove vowels from each word in the table name except for the first vowel of each word.
      •  If the column name is still greater than 30 characters, use standardized shorthand indicators. Record this standard for consistent use.

Oracle index naming Standards

  • Index Standards
    • Index names should follow this standard:
IDX_ttttt_nn
Where IDX = Index
tttt = Table name the index is built on
nn = Numeric value that makes each table index unique.
    • If an index name should exceed 30 characters, reduce the size of the index name in this order:
      • From the left of the index name, remove vowels from each word in the table name except for the first vowel of each word.
      •  If the index name is still greater than 30 characters, use standardized shorthand indicators. Record this standard for consistent use.

Oracle constraints naming Standards

  • Constraint Standards
    • Primary key constraints will follow this naming convention:
      • PK_nnnnn 
        Where nnnn = The table name that the index is built on.

         
      • UK_nnnnn_nnWhere nnnn = The table name that the index is built on.
                        nn =  A number that makes the constraint unique.

         
      • FK_pppp_cccc_nn
        Where pppp = The parent table name
                    cccc = The child parent table name
                        nn = A number that makes the constraint unique

         
Sample names might include:
  • tables names - persons, islands, dsm_iv_codes

     
  • table column names - first_name, dsm_iv_code_description

     
  • constraint names - pk_ehd_food_establishment, fk_ehd_food_establishment_01

     
  • index names - idx_ssd_dsm_01

Oracle application naming Standards

Application Prefixes - All table/index/column/constraint names will use standard prefixes.  Each application area will be identified with a three-character abbreviation, and this abbreviation will be used for the names of all tables, indexes and constraints.  We will not use system-generated constraint or index names.  For example, assume we have these two application areas:
  • General cross-area objects = GEN
  • Social Services Department = SSD
  • Health Services Department = HSD
Object names - To simplify development, we will follow these standards that allow the developer to quickly identify each metadata object, with complete descriptive names:
  • The application prefix will be used in all metadata entries, including tables, indexes, constraints and table columns.
     
  • The table name will be included in all index, constraint and table column names.
     
  • The type of constraint will be specified in all constraint names, using the abbreviations PK, FK and CHECK



References:

-http://www.dba-oracle.com/standards_schema_object_names.htm
-http://www.toadworld.com/Portals/0/stevenf/Naming%20Conventions%20and%20Coding%20Standards.pdf


Saturday, January 26, 2013

SQL :: Information Schema Views

You can select the structure of your schema (tables, columns, ...etc.) in most DBs

for example SQL using what is called Information Schema Views

SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE='BASE TABLE'
and oracle uses:
SELECT owner, table_name
  FROM dba_tables
or
SELECT owner, table_name
  FROM all_tables
or
SELECT table_name
  FROM user_tables
good luck :)

Java Code Convention

My code is returning the right results wohoooo :D, finally i will deliver it to my technical manager and go to sleep, WAAAAAAAAAAAAAAAAAAIT don't go until you do the following!!

1- Make sure that no one will ever realize why you named the variables.
2- Make sure that no one could know how you named your methods, it is your copy rights! daa!
3- Make sure not to add any inline comments in your code, so no one can find out what you mean!! haha!
4- Put all of your code in one class and all method function in one method, it will looks that you put a great effort in it. :D
5- Be different add a caps to package names and don't ever start with a caps letter in class.
6- try to put all of your code in one line.

Off course i was kidding please developers please please please apply the following convention:
http://www.oracle.com/technetwork/java/codeconventions-150003.pdf

Have a nice day :)

Java :: ArrayList VS Vector



ArrayList or Vector?

This is one of the famous questions that a Java beginner has in his mind. This is also a famous question asked in interviews. Following are the differences between ArrayList and Vector.

1. Vectors and Hashtable classes are available from the initial JDK 1.0. But, ArrayList and HashMap are added as a part of new Collections API since JDK 1.2.

2. Vectors and Hashtable are synchronized where as ArrayList and HashMap are unsynchronized.

When to use Vector? When to use ArrayList? 

1. ArrayList is faster when compared to Vector since ArrayList is unsynchronized. So, if the List will be modified by only one thread, use ArrayList. If the list is a local variable, you can always use ArrayList.
2. If the List will be accessed by multiple threads, always use Vector, otherwise you should take care of synchronization manually.

To visualize the problem with synchronization, try the following code.

There is a Producer class that adds 5000 elements to the List (ArrayList/Vector). Another class, Consumer class removes 5000 elements from the same list. There are around 10 producer threads and 10 consumer threads.

Reference:
http://skeletoncoder.blogspot.com/2006/09/java-tutorials-arraylist-or-vector.html