egovernment Authority [Sharmila Naveen] [07/04/2010]
|
|
|
- Brittney Webb
- 9 years ago
- Views:
Transcription
1 Java Standards [Sharmila Naveen] [07/04/2010] Saved 8 May, 2011 Page 1 of 31
2 Table of Contents 1. Introduction 3 2. Purpose and Scope 3 3. File Organization 3 4. Source code style guidelines Beginning Comments Indentation Left and Right braces Wrapping Lines White Space Blank Spaces Implementation Comments Methods Declarations Standards for Statements Standards for Methods Naming Convention standards Variable Assignments Standards for Classes, Interfaces, Packages, and Compilation Units Standards for Classes Standards for Interfaces Standards for Packages 20 Annexure A: Technical points 29 Saved 8 May, 2011 Page 2 of 31
3 1. Introduction To build enterprise Java applications, which are reliable, scalable and maintainable, it is important for development teams to adopt proven design techniques and good coding standards. The adoption of coding standards results in code consistency, which makes it easier to understand, develop and maintain the application. In addition by being aware of and following the right coding techniques at a granular level, the programmer can make the code more efficient and performance effective. 2. Purpose and Scope An effective mechanism of institutionalizing production of quality code is to develop programming standard and enforce the same through code reviews. This document delves into some fundamental Java programming techniques and provides a rich collection of coding practices to be followed by JAVA/J2EE based application development teams The best practices are primarily targeted towards improvement in the readability and maintainability of code with keen attention to performance enhancements. By employing such practices the application development team can demonstrate their proficiency, profound knowledge and professionalism. This document is written for professional Java software developers to help them: Write Java code that is easy to maintain and enhance Increase their productivity 3. File Organization Java source are named as *. java while the compiled Java byte code is named as *.class file. Each Java source file contains a single public class or interface. Each class must be placed in a separate file. This also applies to non-public classes too. If a file consists of sections, they should be separated by blank lines and an optional comment, identifying each section. Files longer than 2000 lines should be avoided. Saved 8 May, 2011 Page 3 of 31
4 Java classes should be packaged in a new java package for each self-contained project or group of related functionality. Preferably there should be an html document file in each directory briefly outlining the purpose and structure of the package. Java Source files should have the following ordering: Package and Import statements, beginning comments, Class and Interface Declarations. There should not be any duplicate import statement. There should not be any hard coded values in code. Max. No of Parameters in any class should be Source code style guidelines 4.1 Beginning Comments All source files should begin with c-style header as follows carrying the Title, Version, Date in mm/dd/yy format and the copyright information. /* /05/02 * Copyright (c) */ The header should be followed the package and import statements and then the documentation comments exactly in the following sequence and indented to the same level. /** * Description <a href="mailto:[email protected]">author s Name</a> 1.0 <a href= spec.html#section >Java Spec</a> since-text */ The tags see, since and deprecated are not mandatory and may be used when required. 4.2 Indentation Saved 8 May, 2011 Page 4 of 31
5 Four spaces should be used as the unit of indentation. The indentation pattern should be consistently followed throughout. 4.3 Left and Right braces The starting brace should be at the end of the conditional and the ending brace must be on a separate line and aligned with the conditional. It is strongly recommended that all conditional constructs define a block of code for single lines of code. 4.4 Wrapping Lines Lines longer than 80 characters should be avoided. When an expression will not fit on a single line, it should be broken according to these general principles: Break after a comma. Break after an operator. Prefer higher-level breaks to lower-level breaks. Align the new line with the beginning of the expression at the same level on the previous line. If the above rules lead to confusing code or to code that's squished up against the right margin, just indent 4 spaces instead. Example: count = number.calculate(bytes, offset, length, value, 0, estimatedcount); long value = ((totalvalue < plannedvalue )? 4.5 White Space Blank Lines totalvalue : plannedvalue ); Blank lines improve readability by setting of sections of code that are logically related. Two blank lines should be used in the following circumstances: Between sections of a source file Between class and interface definitions One blank line should always be used in the following circumstances: Saved 8 May, 2011 Page 5 of 31
6 Between methods. Between the local variables in a method and its first statement. Before a block or single-line comment. Between logical sections inside a method to improve readability. Before and after comments. 4.6 Blank Spaces Blank spaces should be used in the following circumstances: Example: A keyword followed by a parenthesis should be separated by a space. Example: while (true) A blank space should appear after commas in argument lists. All binary operators except a period. should be separated from their operands by spaces. Blank spaces should never separate unary operators such as unary minus, increment ( ++ ), and decrement ( -- ) from their operands. The expressions in a for statement should be separated by blank spaces. for (expr1; expr2; expr3) mymethod((byte) Num, (Object) y); mymethod((int) (c + 15), (int) (j + 4) ); Casts should be followed by a blank space. However blank space should not be used between a method name and its opening parenthesis. This helps to distinguish keywords from method calls. 4.7 Implementation Comments Java codes should have implementation comments delimited by /*...*/ or //. For commenting out code a double slash i.e. // is recommended, while for multiple or single-line comments given as overview of code, the c-style comments i.e. /* */ should be used. For clarity in code, comments should be followed by a blank line. Code should have four styles of implementation comments as follows and anything that goes against a standard should always be document. Saved 8 May, 2011 Page 6 of 31
7 Block Comments Block comments are used to provide descriptions of files, methods, data structures and algorithms. Block comments should be used at the beginning of each file and in places where code is to be explained. They can be used in places such as before or within methods. Block comments inside a method should be indented to the same level as the code they describe. A block comment should be preceded by a blank line to set it apart from the rest of the code. Block comments should be delimited by /*...*/. During the process of development, the developer may need to leave some portions of the code to be reviewed and enhanced later. These portions should be specifically commented with a /* FIX ME */ tag specifying clearly the modifications to be made and the date of marking. This construct should however be sparingly used. Single-Line & Trailing Comments Short comments can appear on a single line indented to the level of the code that follows. A single-line comment may be preceded by a blank line if it gives clarity to code. It is recommended that single-line comments also be delimited by /*...*/. Very short comments may appear on the same line as the code they describe, but should be shifted far enough to separate them from the statements. They may be used for explaining the use of a variable or any statement and should also be delimited by /*...*/. Commenting Codes The // comment delimiter can comment out a complete line or only a partial line. It should not be used on consecutive multiple lines for text comments, however, it may be used in single or consecutive multiple lines for commenting out sections of code. Documentation Comment Java codes should have documentation comments delimited by /**...*/. Documentation comments are meant to describe the specification of the code, from an implementation-free perspective to be read by developers who might not necessarily have the source code at hand. Simple Documentation comments should add to the clarity of code and should be followed by a blank line. Classes and Interfaces Saved 8 May, 2011 Page 7 of 31
8 All comments using javadoc conventions should be shown. Each class should be documented describing the purpose of the class, guaranteed invariants, usage instructions, and/or usage examples. Also including any reminders or disclaimers about required or desired improvements using the tags mentioned in Section Variables First the static variables should be declared in the sequence public also all the static variables defined before the methods in the classes, then protected, then package level and then the private followed by instance variables in the same sequence. Nature, purpose, constraints, and usage of static and instances variables should be documented using javadoc conventions. A blank line should follow the declarations. /** Document the variable ClassName#method() */ OPERATORS The parenthesis should be effectively used to avoid operator precedence. /** * Description: 4.8 Methods Each method should declare the javadoc tags exactly in the sequence as given below. Each line item begins with an asterisk. All subsequent lines in multiline component are to be indented so that they line up vertically with the previous line. For reference, the javadoc tags are explained in detail in Annexure. Example <Mandatory Tag> for description of each parameter <Mandatory Tag> except for constructor and void> <Optional Tag> <Optional Tag> <Optional Tag> <Optional Tag> */ Saved 8 May, 2011 Page 8 of 31
9 Description Every method should include a header at the top of the source code that documents all of the information that is critical to understanding it. Detailed description of the method may include the intent of method i.e. what and why the method does, what a method should be passed as parameters and what it returns, any Known bugs, exceptions that the method throws, information on visibility decisions., how a method changes the object, pre and post conditions, side effects, dependencies, implementation notes, who should be calling this method, whether the method should or should not be overridden, where to invoke super when overriding, control flow or state dependencies that need to exist before calling this method. PARAMETER SECTION Describes the type, class, or protocol of all the method or routine arguments. Should describe the parameters intended use and constraints. Every function parameter value should be checked before being used (Usually check for nulls and Data Validation). EXAMPLE: asource the input source string which cannot be 0-length. RETURNS SECTION This section is used to describe the method return type. Specifically, it needs to detail the actual data type returned, the range of possible return values, and where applicable, error information returned by the method. Every function should return the correct value at every function return point or throw correct Exceptions in case of Errors. Example: Possible values are 1..n. EXCEPTION SECTION The purpose section is a complete description of all the non-system exceptions that this method throws. A description about whether the exception is recoverable or not should also be included. If applicable, a recovery strategy for the exception can be described here. Saved 8 May, 2011 Page 9 of 31
10 ResourceNotFoundException. recoverable. Annexure explains the commonly used tags for javadoc. In addition to the method documentation, it is also required to include comments within the methods to make it easier to understand, maintain, and enhance. The control structures i.e. what each control structure, such as loop, does should be documented. Any assumptions or calculations should be documented. Each local variable should have an end line comment describing its use. Any complex code in a method should be documented if it is not obvious. If there are statements that must be executed in a defined order then this fact should be documented. 5.0 Declarations One declaration per line is recommended since it encourages commenting and enhances the clarity of code. The order and position of declaration should be as follows: First the static/class variables should be placed in the sequence: First public class variables, protected, package/default level i.e. with no access modifier and then the private. As far as possible static or class fields should be explicitly instantiated by use of static initializers because instances of a class may sometimes not be created before a static field is accessed. Instance variables should be placed in the sequence: First public instance variables, protected, package level with no access modifier and then private. Next the class constructors should be declared. This should be followed by the inner classes, if applicable Class methods should be grouped by functionality rather than by scope or accessibility to make reading and understanding the code easier. Declarations for local variables should be only at the beginning of blocks e.g. at the beginning of a trycatch construct. Saved 8 May, 2011 Page 10 of 31
11 Local declarations that hide declarations at higher levels should be avoided. For example, same variable name in an inner block. Numerical constants should not be coded directly except 1, 0, Standards for Statements Each line should contain at most one statement. While compound statements are statements that contain lists of statements enclosed in braces. The enclosed statements should be indented one more level than the compound statement. The opening brace should be at the end of the line that begins the compound statement. The closing brace should begin a line and be indented to the beginning of the compound statement. Braces should be used around all statements, even single statements, when they are part of a control structure, such as a if-else or for statement. A boolean expression / function should only be compared to a boolean constants. goto statements should be avoided. Try to move invariable computation outside the loop. E.g. D += 9*24*pie *x Where pie is a constant then 9*24*pie can be moved out and assigned to a local variable and used inside a loop where x changes in the loop return Statements A return statement with a value should not use parentheses unless they make the return value more obvious in some way. Example: return; return mydisk.size(); return (size? size : defaultsize); if, if-else Statements Saved 8 May, 2011 Page 11 of 31
12 The if keyword and conditional expression must be placed on the same line. The if statements must always use braces {} Example: if (expression) { statement; } else { statement; } for Statements A for statement should have the following form: for ( int i = 0; i < 10; i++ ) { } System.out.println(i); When using the comma operator in the initialization or update clause of a for statement, avoid the complexity of using more than three variables. If needed, separate statements before the for loop (for the initialization clause) or at the end of the loop (for the update clause) may be used. The keyword for and the parenthesis should be separated by a space and the expressions in a for statement should be separated by blank space. The statement block is placed on the next line. The closing curly brace starts in a new line, indented to match its corresponding opening statement. while Statements The while construct uses the same layout format as the if construct. The while keyword should appear on its own line, immediately followed by the conditional expression. The keyword while and the parenthesis should be separated by a space. The statement block is placed on the next line. The closing curly brace starts in a new line, indented to match its corresponding opening statement. Example: while (expression) { } statement; Saved 8 May, 2011 Page 12 of 31
13 do-while Statements The DO..WHILE form of the while construct should appear as shown below: Examples: do { statement; } while (expression); The statement block is placed on the next line. The closing curly brace starts in a new line, indented to match its corresponding opening statement. switch Statements The switch construct should use the same layout format as the if construct. The switch keyword should appear on its own line, immediately followed by its test expression. The keyword switch and the parenthesis should be separated by a space. The statement block should be placed on the next line. The closing curly brace starts in a new line, indented to match its corresponding opening statement. Every time a case falls through, i.e. does not include a break statement, a comment should be added where the break statement would normally be. Every switch statement must include a default case. A break in the default case is redundant, but it prevents error if another case is added later and therefore may be added. All missing switch case break statements should be correct and marked with a comment. Examples: switch (expression) { case n: statement; break; case x: statement; /* Continue to default case */ default: /* always add the default case */ Saved 8 May, 2011 Page 13 of 31
14 statement; break; } try-catch Statements In the try/catch construct the try keyword should be followed by the open brace in its own line. This is followed by the statement body and the close brace on its own line. This may follow any number of catch phrases - consisting of the catch keyword and the exception expression on its own line with the catch body; followed by the close brace on its own line. Try-catch should be accomplish with finally block to destroys all Objects not required. There should not be any empty try-catch blocks. Example: try { statement; } catch (ExceptionClass e) { statement; } finally { statement; } Naming Conventions Naming conventions make programs more understandable by making them easier to read. Following conventions should be followed while naming a class or a member: Use full English descriptors that accurately describe the variable, method or class. For example, use of names like totalsales, currentdate instead of names like x1, y1, or fn. Terminology applicable to the domain should be used. Implying that if user refers to clients as customers, then the term Customer should be used for the class, not Client. Mixed case should be used to make names readable with lower case letters in general capitalizing the first letter of class names and interface names. Abbreviations should not be used as far as possible, but if used, should be documented and consistently used. Saved 8 May, 2011 Page 14 of 31
15 Very long or similar names for classes or methods should be avoided. Standard acronyms such as SQL should also be represented in mixed case as sqldatabase(). 7.0 Standards for Methods Naming Methods Getters Setters Getters for Constants Methods should be named using a full English description, using mixed case with the first letter of any non-initial word capitalized. It is also common practice for the first word of a method name to be a strong, active verb. e.g. getvalue(), printdata(), save(),delete(). This convention results in methods whose purpose can often be determined just by looking at its name. It is recommended that accessor methods be used to improve the maintainability of classes. Getters are methods that return the value of a field. The word get should be prefixed to the name of the field, unless it is a boolean field where is should be prefixed to the name of the field. e.g. gettotalsales(), ispersistent(). Alternately the prefix has or can instead of is for boolean getters may be used. For example, getter names such as hasdependents() and canprint() can be created. Getters should always be made protected, so that only subclasses can access the fields except when an outside class needs to access the field when the getter method may be made public and the setter protected. Setters, also known as mutators, are methods that modify the values of a field. The word set should be prefixed to the name of the field for such methods type. Example: settotalsales(), setpersistent(boolean ispersistent) Constant values may need to be changed over a period of time. Therefore constants should be implemented as getter methods. By using accessors for constants there is only one source to retrieve the value. This increases the maintainability of system. Accessors for Collections Saved 8 May, 2011 Page 15 of 31
16 The main purpose of accessors is to encapsulate the access to fields. Collections, such as arrays and vectors need to have getter and setter method and as it is possible to add and remove to and from collections, accessor methods need to be included to do so. The advantage of this approach is that the collection is fully encapsulated, allowing changes later like replacing it with another structure, like a linked list. Examples: getorderitems(), setorderitems(), insertorderitem(), deleteorderitem(), neworderitem() Method Visibility For a good design, the rule is to be as restrictive as possible when setting the visibility of a method. If a method doesn t have to be private then it should have default access modifier, if it doesn t have to be default then it should be made protected and if it doesn t have to protected only then it should be made public. Wherever a method is made more visible it should be documented why. Access modifier for methods should be explicitly mentioned in cases like interfaces where the default permissible access modifier is public. Standards for Parameters (Arguments) To Methods Parameters should be named following the same conventions as for local variables. Parameters to a method are documented in the header documentation for the method using the javadoc@param tag. However: Cascading method calls like method1().method2() should be avoided. Overloading methods on argument type should be avoided. It should be declared when a class or method is thread-safe. Synchronized methods should be preferred over synchronized blocks. The fact that a method invokes wait should always be documented Abstract methods should be preferred in base classes over those with default no-op implementations. All possible overflow or underflow conditions should be checked for a computation. There should be no space between a method/constructor name and the parenthesis but there should be a blank space after commas in argument lists. Saved 8 May, 2011 Page 16 of 31
17 public void dosomething( String firststring, String secondstring ) { } 8. 0 Naming Convention standards Naming Variables Use a full English descriptor for variable names to make it obvious what the field represents. Fields, that are collections, such as arrays or vectors, should be given names that are plural to indicate that they represent multiple values. Variable names should not start with an underscore _ or dollar sign $ characters and should be short and meaningful. The choice of a variable name should be mnemonic i.e., designed to indicate to the casual observer the intent of its use. Single character variable names should be avoided except for temporary throwaway variables. Naming Components For names of components, full English descriptor should be used, post fixed by the Component type. This makes it easy to identify the purpose of the component as well as its type, making it easier to find each component in a list. Therefore names like NewHelpMenuItem, CloseButton should be preferred over Button1, Button2, etc. Naming Constants Constants, whose values that do not change, are typically implemented as static final fields of classes. They should be represented with full English words, all in uppercase, with underscores between the words like FINAL_VALUE. Naming Collections A collection, such as an array or a vector, should be given a pluralized name representing the types of objects stored by the array. The name should be a full English descriptor with the first letter of all non-initial words capitalized like customers, orderitems, aliases Naming Local Variables In general, local variables are named following the same conventions as used for fields, in other words use of full English descriptors with the first letter of any non-initial word in uppercase. For the sake of convenience, however, this naming convention is relaxed for several specific types of local variable like Streams, Loop counters, Exceptions. Saved 8 May, 2011 Page 17 of 31
18 Name hiding or data hiding refers to the practice of naming a local variable, argument, or methods the same or similar as that of another one of greater scope in same or super class. This may lead to confusion and should be avoided. Naming Streams When there is a single input and/or output stream being opened, used, and then closed within a method the common convention is to use in and out for the names of these streams, respectively. Naming Loop Counters Loop counters are a very common use for local variables therefore the use of i, j, or k, is acceptable for loop counters where they are obvious. However, if these names are used for loop counters, they should be used consistently. For complex nested loops the counters should be given full meaningful English descriptors. 9.0 Variable Assignments Assigning several variables to the same value in a single statement should be avoided, i.e., we should avoid constructs like var1 = var2 = var3 = 0; Assignment operator should not be used in a place where it can be easily confused with the equality operator. Embedded assignments in an attempt to improve run-time performance should be avoided Variable Visibility For reasons of encapsulation, fields should not be declared public. All fields should be declared private unless necessary otherwise. Fields should never be accessed directly, instead accessor methods should be used i.e. private members should be accessed through methods. All fields should be declared private and accessed by getter and setter methods also called accessors. Documenting & Declaring a Variable Every field should be documented well enough so that other developers can understand it. There is a need to document description, all applicable invariants, visibility decisions. Wherever a field is made more Saved 8 May, 2011 Page 18 of 31
19 visible it should be documented why. There are some conventions regarding the declaration and documentation of local variable. These conventions are: Declare one local variable per line of code. Document local variables with an end line comment. Declare local variables at the top of the block of code. Use local variables for one thing only at a time. However the following should be taken into consideration while using variables: Instance variables should not be declared public. Implicit initializers for static or instance variables should not be relied and initialization should be explicit. Use of static should be minimized as they act like globals. They make methods more contextdependent, hide possible side effects, sometimes present synchronized access problems and are the source of fragile, non-extensible constructions. Also, neither static variables nor methods are overridable in any useful sense in subclasses. Generally prefer double to float and use int for compatibility with standard Java constructs and classes. Use final and/or comment conventions to indicate whether instance variables that never have their values changed after construction are intended to be constant (immutable) for the lifetime of the object. Declare and initialize a new local variable rather than reusing/reassigning an existing one whose value happens to no longer be used at that program point. Assign null to any reference variable that is no longer being used to enable garbage collection. Same names of variables or methods should be avoided in methods and subclasses Standards for Classes, Interfaces, Packages, and Compilation Units Saved 8 May, 2011 Page 19 of 31
20 10.1 Standards for Classes Naming Classes Class Visibility Documenting a Class Class names should be simple full English descriptor nouns, in mixed case starting with the first letter capitalized and the first letter of each internal word also capitalized. Whole words should be used instead of acronyms and abbreviations unless the abbreviation is more widely used than the long form, such as URL or HTML. Package or default visibility may be used for classes internal to a component while public visibility may be used for other components. However, for a good design, the rule is to be as restrictive as possible when setting the visibility. The reason why the class is public should be documented. Each class should have an appropriate constructor. The documentation comments for a class start with the header for class with filename, version, copyright and related information. The documentation comments should precede the definition of a class and should contain necessary information about the purpose of the class, details of any known bugs, examples etc. as illustrated in. The development/maintenance history of the class should be entered as comments in the configuration management tool at the time of baselining the source code and in the file header as well Standards for Interfaces The Java convention is to name interfaces using mixed case with the first letter of each word capitalized like classes. The preferred convention for the name of an interface is to use a descriptive adjective, such as Runnable or Cloneable. Interfaces should be documented specifying the purpose of the interface and how it should and shouldn t be used. Method declarations in interfaces should explicitly declare the methods as public for clarity Standards for Packages Naming Packages The rules associated with the naming of packages are as follows: Unless required otherwise, a package name should include the organization s domain name, with the toplevel domain type in lower case ASCII letters i.e. com.<name of company> followed by project name and sub project name as specified in ISO Standard 3166, Saved 8 May, 2011 Page 20 of 31
21 Subsequent components of the package name vary according to requirements. Package names should preferably be singular Documenting a Package There should be one or more external documents in html format with the package name that describe the purpose of the packages documenting the rationale for the package, the list of classes and interfaces in the package with a brief description of each so that other developers know what the package contains Configuration Management While controlling the source code in configuration management tool the development/maintenance history of the class should be entered as comments in the configuration management tool. The comments should include details like name of the java file and package, name of method/s changed/ modified/ added / deleted, brief description of changes, name of author/s or modifier/s and reference of any known or fixed bugs Best Practices Efficient String Concatenation:- For making a long string by adding different small strings always use append method of java.lang.stringbuffer and never use ordinary + operator for adding up strings. Optimal Use Of Garbage Collector: - For easing out the work of java Garbage Collector always set all referenced variables used to null explicitly thus de-referencing the object which is no more required by the application and allowing Garbage Collector to swap away that variable thus realizing memory. Writing Oracle Stored Procedures Optimally:- Avoid using IN and NOT IN clause and rather try to use OR operator for increasing the response time for the Oracle Stored Procedures. Using variables in any Code Optimally:- Try to make minimum number of variables in JSP/Java class and try to use already made variables in different algorithms shared in same JSP/Java class by setting already populated variable to null and then again populating that variable with new value and then reusing them. Saved 8 May, 2011 Page 21 of 31
22 Try to write minimum java code in JSPs:- Big patches of java code in JSP should be avoided and is should be rather shifted to some Wrapper/Helper/Bean class which should be used together with every JSP. Number of method calls from JSP should be reduced as much as possible to achieve maximum efficiency and the least response time. In brief JSP should be designed as light as possible. Try to reduce the number of hits to database:- Number of hits to the database should be reduced to minimum by getting data in a well arranged pattern in minimum number of hits by making the best use of joins in the database query itself rather than getting dispersed data in more number of hits. Note:- If the data is very large then this approach should be avoided since it slow down the loading of the JSP page itself on the client. Caching of EJB References:- To avoid costly lookup every time any remote object is required, its better to cache the home reference and reusing it. Note:- With time the cached home reference may get stale so proper care should be take to do a relookup as soon as such a situation arises. Heavy Objects should not be stored in Session of JSPs:- Storing heavy objects in the Session can lead to slowing of the running of the JSP page so such case should be avoided. Always Use JDBC connection Pooling:- Always use javax.sql.datasource which is obtained through a JNDI naming lookup. Avoid the overhead of acquiring a javax.sql.datasource for each SQL access. This is an expensive operation that will severely impact the performance and scalability of the application. Release HttpSessions when finished:- Abandoned HttpSessions can be quite high.httpsession objects live inside the engine until the application explicitly and programmatically releases it using the API, javax.servlet.http.httpsession.invalidate (); quite often, programmatic invalidation is part of an application logout function. Saved 8 May, 2011 Page 22 of 31
23 Release JDBC resources when done:- Failing to close and release JDBC connections can cause other users to experience long waits for connections. Although a JDBC connection that is left unclosed will be reaped and returned by Application Server after a timeout period, others may have to wait for this to occur. Close JDBC statements when you are through with them. JDBC ResultSets can be explicitly closed as well. If not explicitly closed, ResultsSets are released when their associated statements are closed. Ensure that your code is structured to close and release JDBC resources in all cases, even in exception and error conditions. Minimize use of System.out.println:- Because it seems harmless, this commonly used application development legacy is overlooked for the performance problem it really is. Because System.out.println statements and similar constructs synchronize processing for the duration of disk I/O,they can significantly slow throughput. Minimum use of java.util.vector:- Since most of the commonly used methods in Vector class are Synchronized which makes any method call or any variable heavy as compared to those which are not synchronized so it s a better practice to use any other Collection sibling whose methods are not synchronized for eg. java.util.arraylist. Vector (and other "classic" utility classes such as Hashtable) are synchronized on all methods. This means that even you do not access the Vector from multiple threads you pay a performance penalty for thread safety. ArrayList is not synchronized by default - although the collections framework provides wrappers to provide thread safety when needed. Which accounts for the memory usage to be very high if they are holding heavy amount of data. Synchronization has a cost Putting synchronized all over the place does not ensure thread safety. Putting synchronized all over the place is likely to deadlock. Putting synchronized all over will slow your code and prevent it from running when it should. This accounts for memory leaks. Using JS files and other include files in Jar:- When we are developing web based large number of include file. All includes file must be put in jar and accessed which is very fast. The method to do that we write a property class and get all the properties from the jar. Saved 8 May, 2011 Page 23 of 31
24 Forgotten references keep Objects alive. Be careful with indexes and caches. Hashtable h = new Hashtable(); Object[] storage = new Object[1000]; h.put(new Integer(1), storage); h.remove(storage); storage = null This accounts for the Memory Leaks Only consider pooling heavy objects: Large Arrays Images Threads With newer Java VMs (i.e. Java HotSpot) the cost of maintaining a pool can outweigh allocation and collection. References Code Conventions for the JavaTM Programming Language ( Java Programming Style Guidelines ( The Java Book by Prateek Khanna AmbySoft Inc. Coding Standards for Java v17.01d ( ChiMu OO and Java Development: Guidelines and Resources v 1.8 ( Annexure 2 : Code Example package com.project1; /* package should follow the naming conventions */ import com.project2.class1; /* Import specific class and not all.*/ /* Leave 2 lines between sections of a source file*/ Saved 8 May, 2011 Page 24 of 31
25 /** * * This is an example class. This class creates an object of <CODE>MyExample * </CODE> class. Detailed description, documentation and code can come here. * If required, an image can be placed here using the img tag in HTML as follows: * <p><img src="images/sample.gif"><p> HTML tags like hyperlinking, table etc. * may be used here, if required. Use code style for Java keywords, package * names, class names, method names, interface names, field names, argument * names, code examples. However formatting tags like H1, H2 should not be used * as javadoc has a consistent format for generating an API. Use tag * to link to another class like {@link com.sample.myexample}. * Code sample may be shown using the blockquote tag as follows * <p><blockquote><pre> import java.awt.*; * import java.applet.applet; * </pre></blockquote> * <a href = "mailto:[email protected]">first Author</a> <a href = "mailto:[email protected]">second Author</a> May 2002 <a href="index.html#section">java Spec</a> com.sample.myexample MyExample Ver As of ver 1.0 */ Saved 8 May, 2011 Page 25 of 31
26 public class MyExample { /** The documentation for public static variable instancecounter MyExample#calculate() */ public static int instancecount = 0; /* Declare public static variable first */ /** * The documentation for private static variable classvar2 that happens to be * more than one line long */ private static Object classvar2; /* Declare public, protected, package & then private static variables.*/ /** The documentation for public instance variable instancevar1 */ public Project instancevar1; /* Declare public instance variable first*/ /** The documentation for protected instance variable instancevar2 */ protected int instancevar2; /** The documentation for private instance variable instancevar3 */ private boolean[] instancevar3; /* One declaration per line.*/ /** Saved 8 May, 2011 Page 26 of 31
27 * Default constructor which creates an empty object of MyExample class. */ public MyExample() { instancecount++; /*implementation for constructor goes here*/ } /** * gets the value of n factorial by performing the operation n! = 1*2*3*...*n int The number whose factorial is to be calculated. int com.sample.myexample#calculate() Ver 1.0 As of Ver 1, replaced by {@link com.sample.myexample#calculate()} */ public int calculate(int number) { int value = 1; /* Declare all variables at the top in the sequence public, protected, default, private, leaving blank line after declarations.*/ if (number > 0) { /* if statements should always use braces */ for (int outer = 1; outer < (number + 1); outer++) { /* Short comment on a single line indented to the level of the code */ value = value * outer; } return value; } else { return 0; /* Short comments can appear in line of code */ } /* shifted far enough to separate from statements. */ Saved 8 May, 2011 Page 27 of 31
28 //if (number < 0 ) { //} Double slash can be used for commenting out sections //else {of code or a single line but not for explanatory // return 0; comments where /* */ should be used. //} } } 13.0 Java Documentation Tags Tag Used for name name name description Interfaces, Classes, Interfaces Interfaces, Classes, Member, Functions Member, Functions Member, Functions Indicates the author(s) of a given piece of code. One tag per author should be used. Indicates that the API for the class has been deprecated and therefore should not be used any more. Describes the exceptions that a member function throws. You should use one tag per exception and give the full class name for the exception. Used to describe a parameter passed to a member, function, including its type/class and its usage. Use one tag per description Member, Functions Describes the return value, if any, of a member function. You should indicate the type/class and the potential use(s) of the ClassName Interfaces, Classes, Member, Functions Classes, Interfaces, Member, Functions, Fields Indicates how long the item has existed, i.e. since JDK 1.1 Generates a hypertext link in the documentation to the specified class. You can, and probably should, use a fully qualified class name. Saved 8 May, 2011 Page 28 of 31
29 Tag Used for ClassName# functionname Classes, Interfaces, Member, Functions, Fields Generates a hypertext link in the documentation to the specified member function. You can, and probably should, use a fully qualified class text Classes, Interfaces Indicates the version information for a given piece of code. Annexure A: Technical points Apart from the standards mentioned already following should be considered while writing java code: Instance /class variables should not be made public as far as possible. A constructor or method must explicitly declare all unchecked (i.e. runtime) exceptions it expects to throw. The caller can use this documentation to provide the proper arguments. Unchecked exceptions should not be used instead of code that checks for an exceptional condition. e.g. Comparing an index with the length of an array is faster to execute and better documented than catching ArrayOutOfBoundsException. If Object.equals is overridden, also override Object.hashCode, and vice-versa. Override readobject and writeobject if a Serializable class relies on any state that could differ across processes,including,in particular,hashcodes and transient fields. If clone() may be called in a class, then it should be explicitly defined, and declare the class as implements Cloneable. Always use method equals instead of operator == when comparing objects. In particular, do not use == to compare Strings unless comparing memory locations. Always embed wait statements in while loops that re-wait if the condition being waited for does not hold. Use notifyall instead of notify or resume when you do not know exactly the number of threads which are waiting for something Saved 8 May, 2011 Page 29 of 31
30 Embed casts in conditionals. This forces to consider what to do if the object is not an instance of the intended class rather than just generating a ClassCastException. For example: C cx = null; if (x instanceof C) { cx = (C) x } else { dosomething(); } When throwing an exception, do not refer to the name of the method which has thrown it but specify instead some explanatory text. Document fragile constructions that have been used solely for the sake of optimization. Document cases where the return value of a called method is ignored. Minimize * forms of import Be precise about what you are importing. Prefer declaring arrays as Type[] arrayname rather than Type arrayname[]. StringBuffer should be preferred for cases involving String concatenations. Wherever required String objects should be preferably created with a new and not with the help of assignment, unless intentionally as they remain in the String pool even after reference is nullified. All class variables must be initialized with null at the point of declaration. All references to objects should be explicitly assigned null when no more in use to make the objects available for garbage collection. As far as possible static or class fields should be explicitly instantiated by use of static initializers because instances of a class may sometimes not be created before a static field is accessed. Minimize statics (except for static final constants). Minimize direct internal access to instance variables inside methods. Declare all public methods as synchronized. Always document the fact that a method invokes wait. Saved 8 May, 2011 Page 30 of 31
31 Classes designed should be easily extensible. This will be very important in the event that the currently designed project needs to be enhanced at a later stage. It is very important to have the finally clause (whenever required) because its absence can cause memory leakage and open connections in a software. Saved 8 May, 2011 Page 31 of 31
Java Application Developer Certificate Program Competencies
Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle
CSE 308. Coding Conventions. Reference
CSE 308 Coding Conventions Reference Java Coding Conventions googlestyleguide.googlecode.com/svn/trunk/javaguide.html Java Naming Conventions www.ibm.com/developerworks/library/ws-tipnamingconv.html 2
Fundamentals of Java Programming
Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors
Java Interview Questions and Answers
1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java
Code convention document Argus-viewer
Code convention document Projectnaam: Auteur(s): Reviewer(s): Software Process case voor master-studie Software Engineering 2007/2008. Robert Baarda (Q&A) Studentnr.: 5821258 Martijn van Beest (Q&A) Ka-Sing
Software Development (CS2500)
(CS2500) Lecture 15: JavaDoc and November 6, 2009 Outline Today we study: The documentation mechanism. Some important Java coding conventions. From now on you should use and make your code comply to the
C Coding Style Guide. Technotes, HowTo Series. 1 About the C# Coding Style Guide. 2 File Organization. Version 0.3. Contents
Technotes, HowTo Series C Coding Style Guide Version 0.3 by Mike Krüger, [email protected] Contents 1 About the C# Coding Style Guide. 1 2 File Organization 1 3 Indentation 2 4 Comments. 3 5 Declarations.
Java Code Conventions. September 12, 1997
Java Code Conventions September 12, 1997 Copyright Information 1997, Sun Microsystems, Inc. All rights reserved. 2550 Garcia Avenue, Mountain View, California 94043-1100 U.S.A. This document is protected
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa September 14, 2011 G. Lipari (Scuola Superiore Sant Anna) Introduction
Topics. Parts of a Java Program. Topics (2) CS 146. Introduction To Computers And Java Chapter Objectives To understand:
Introduction to Programming and Algorithms Module 2 CS 146 Sam Houston State University Dr. Tim McGuire Introduction To Computers And Java Chapter Objectives To understand: the meaning and placement of
CS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
Object Oriented Software Design
Object Oriented Software Design Introduction to Java - II Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 28, 2010 G. Lipari (Scuola Superiore Sant Anna) Introduction
Taxi Service Coding Policy. Version 1.2
Taxi Service Coding Policy Version 1.2 Revision History Date Version Description Author 2012-10-31 1.0 Initial version Karlo Zanki 2012-11-18 1.1 Added a section relative to Java/Android Fabio Kruger 2013-01-02
Moving from CS 61A Scheme to CS 61B Java
Moving from CS 61A Scheme to CS 61B Java Introduction Java is an object-oriented language. This document describes some of the differences between object-oriented programming in Scheme (which we hope you
The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0
The following applies to all exams: Once exam vouchers are purchased you have up to one year from the date of purchase to use it. Each voucher is valid for one exam and may only be used at an Authorized
Java SE 8 Programming
Oracle University Contact Us: 1.800.529.0165 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features and Application Programming
Dinopolis Java Coding Convention
Dinopolis Java Coding Convention Revision : 1.1 January 11, 2001 Abstract Please note that this version of the Coding convention is very much based on IICM s internal Dino coding convention that was used
AP Computer Science Java Subset
APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall
AppendixA1A1. Java Language Coding Guidelines. A1.1 Introduction
AppendixA1A1 Java Language Coding Guidelines A1.1 Introduction This coding style guide is a simplified version of one that has been used with good success both in industrial practice and for college courses.
Specialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools A. NAME OF INSTITUTE Centre For Development of Advanced Computing B. NAME/TITLE OF THE COURSE C. COURSE DATES WITH DURATION
Java 7 Recipes. Freddy Guime. vk» (,\['«** g!p#« Carl Dea. Josh Juneau. John O'Conner
1 vk» Java 7 Recipes (,\['«** - < g!p#«josh Juneau Carl Dea Freddy Guime John O'Conner Contents J Contents at a Glance About the Authors About the Technical Reviewers Acknowledgments Introduction iv xvi
Storage Classes CS 110B - Rule Storage Classes Page 18-1 \handouts\storclas
CS 110B - Rule Storage Classes Page 18-1 Attributes are distinctive features of a variable. Data type, int or double for example, is an attribute. Storage class is another attribute. There are four storage
Java (12 Weeks) Introduction to Java Programming Language
Java (12 Weeks) Topic Lecture No. Introduction to Java Programming Language 1 An Introduction to Java o Java as a Programming Platform, The Java "White Paper" Buzzwords, Java and the Internet, A Short
Building a Multi-Threaded Web Server
Building a Multi-Threaded Web Server In this lab we will develop a Web server in two steps. In the end, you will have built a multi-threaded Web server that is capable of processing multiple simultaneous
Glossary of Object Oriented Terms
Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction
Web Development in Java
Web Development in Java Detailed Course Brochure @All Rights Reserved. Techcanvass, 265, Powai Plaza, Hiranandani Garden, Powai, Mumbai www.techcanvass.com Tel: +91 22 40155175 Mob: 773 877 3108 P a g
First Java Programs. V. Paúl Pauca. CSC 111D Fall, 2015. Department of Computer Science Wake Forest University. Introduction to Computer Science
First Java Programs V. Paúl Pauca Department of Computer Science Wake Forest University CSC 111D Fall, 2015 Hello World revisited / 8/23/15 The f i r s t o b l i g a t o r y Java program @author Paul Pauca
Java EE Web Development Course Program
Java EE Web Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive types, variables, basic operators, expressions,
Computer Programming I
Computer Programming I Levels: 10-12 Units of Credit: 1.0 CIP Code: 11.0201 Core Code: 35-02-00-00-030 Prerequisites: Secondary Math I, Keyboarding Proficiency, Computer Literacy requirement (e.g. Exploring
Course Number: IAC-SOFT-WDAD Web Design and Application Development
Course Number: IAC-SOFT-WDAD Web Design and Application Development Session 1 (10 Hours) Client Side Scripting Session 2 (10 Hours) Server Side Scripting - I Session 3 (10 hours) Database Session 4 (10
Specialized Programme on Web Application Development using Open Source Tools
Specialized Programme on Web Application Development using Open Source Tools Objective: At the end of the course, Students will be able to: Understand various open source tools(programming tools and databases)
Official Android Coding Style Conventions
2012 Marty Hall Official Android Coding Style Conventions Originals of Slides and Source Code for Examples: http://www.coreservlets.com/android-tutorial/ Customized Java EE Training: http://courses.coreservlets.com/
Core Java+ J2EE+Struts+Hibernate+Spring
Core Java+ J2EE+Struts+Hibernate+Spring Java technology is a portfolio of products that are based on the power of networks and the idea that the same software should run on many different kinds of systems
Chapter 2 Introduction to Java programming
Chapter 2 Introduction to Java programming 1 Keywords boolean if interface class true char else package volatile false byte final switch while throws float private case return native void protected break
PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON
PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London
Embedded Systems. Review of ANSI C Topics. A Review of ANSI C and Considerations for Embedded C Programming. Basic features of C
Embedded Systems A Review of ANSI C and Considerations for Embedded C Programming Dr. Jeff Jackson Lecture 2-1 Review of ANSI C Topics Basic features of C C fundamentals Basic data types Expressions Selection
Java Programming Language
Lecture 1 Part II Java Programming Language Additional Features and Constructs Topics in Quantitative Finance: Numerical Solutions of Partial Differential Equations Instructor: Iraj Kani Subclasses and
Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.
Retrieving Data Using the SQL SELECT Statement Objectives After completing this lesson, you should be able to do the following: List the capabilities of SQL SELECT statements Execute a basic SELECT statement
JavaScript: Introduction to Scripting. 2008 Pearson Education, Inc. All rights reserved.
1 6 JavaScript: Introduction to Scripting 2 Comment is free, but facts are sacred. C. P. Scott The creditor hath a better memory than the debtor. James Howell When faced with a decision, I always ask,
DIPLOMADO DE JAVA - OCA
DIPLOMADO DE JAVA - OCA TABLA DE CONTENIDO INTRODUCCION... 3 ESTRUCTURA DEL DIPLOMADO... 4 Nivel I:... 4 Fundamentals of the Java Programming Language Java SE 7... 4 Introducing the Java Technology...
Computer Programming I
Computer Programming I COP 2210 Syllabus Spring Semester 2012 Instructor: Greg Shaw Office: ECS 313 (Engineering and Computer Science Bldg) Office Hours: Tuesday: 2:50 4:50, 7:45 8:30 Thursday: 2:50 4:50,
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq
qwertyuiopasdfghjklzxcvbnmqwerty uiopasdfghjklzxcvbnmqwertyuiopasd fghjklzxcvbnmqwertyuiopasdfghjklzx cvbnmqwertyuiopasdfghjklzxcvbnmq Introduction to Programming using Java wertyuiopasdfghjklzxcvbnmqwertyui
Handout 1. Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner.
Handout 1 CS603 Object-Oriented Programming Fall 15 Page 1 of 11 Handout 1 Introduction to Java programming language. Java primitive types and operations. Reading keyboard Input using class Scanner. Java
Chapter 1 Java Program Design and Development
presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented
Java Programming Fundamentals
Lecture 1 Part I Java Programming Fundamentals Topics in Quantitative Finance: Numerical Solutions of Partial Differential Equations Instructor: Iraj Kani Introduction to Java We start by making a few
Introduction to Java Applications. 2005 Pearson Education, Inc. All rights reserved.
1 2 Introduction to Java Applications 2.2 First Program in Java: Printing a Line of Text 2 Application Executes when you use the java command to launch the Java Virtual Machine (JVM) Sample program Displays
CS11 Java. Fall 2014-2015 Lecture 7
CS11 Java Fall 2014-2015 Lecture 7 Today s Topics! All about Java Threads! Some Lab 7 tips Java Threading Recap! A program can use multiple threads to do several things at once " A thread can have local
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2015 The third
Accessing Data with ADOBE FLEX 4.6
Accessing Data with ADOBE FLEX 4.6 Legal notices Legal notices For legal notices, see http://help.adobe.com/en_us/legalnotices/index.html. iii Contents Chapter 1: Accessing data services overview Data
Java SE 7 Programming
Java SE 7 Programming The second of two courses that cover the Java Standard Edition 7 (Java SE 7) Platform, this course covers the core Application Programming Interfaces (API) you will use to design
General Software Development Standards and Guidelines Version 3.5
NATIONAL WEATHER SERVICE OFFICE of HYDROLOGIC DEVELOPMENT Science Infusion Software Engineering Process Group (SISEPG) General Software Development Standards and Guidelines 7/30/2007 Revision History Date
C++ INTERVIEW QUESTIONS
C++ INTERVIEW QUESTIONS http://www.tutorialspoint.com/cplusplus/cpp_interview_questions.htm Copyright tutorialspoint.com Dear readers, these C++ Interview Questions have been designed specially to get
Name: Class: Date: 9. The compiler ignores all comments they are there strictly for the convenience of anyone reading the program.
Name: Class: Date: Exam #1 - Prep True/False Indicate whether the statement is true or false. 1. Programming is the process of writing a computer program in a language that the computer can respond to
JavaScript: Control Statements I
1 7 JavaScript: Control Statements I 7.1 Introduction 2 The techniques you will learn here are applicable to most high-level languages, including JavaScript 1 7.2 Algorithms 3 Any computable problem can
Java SE 7 Programming
Oracle University Contact Us: 1.800.529.0165 Java SE 7 Programming Duration: 5 Days What you will learn This Java SE 7 Programming training explores the core Application Programming Interfaces (API) you'll
JAVA - QUICK GUIDE. Java SE is freely available from the link Download Java. So you download a version based on your operating system.
http://www.tutorialspoint.com/java/java_quick_guide.htm JAVA - QUICK GUIDE Copyright tutorialspoint.com What is Java? Java is: Object Oriented Platform independent: Simple Secure Architectural- neutral
PL / SQL Basics. Chapter 3
PL / SQL Basics Chapter 3 PL / SQL Basics PL / SQL block Lexical units Variable declarations PL / SQL types Expressions and operators PL / SQL control structures PL / SQL style guide 2 PL / SQL Block Basic
Java SE 7 Programming
Oracle University Contact Us: Local: 1800 103 4775 Intl: +91 80 4108 4709 Java SE 7 Programming Duration: 5 Days What you will learn This Java Programming training covers the core Application Programming
#820 Computer Programming 1A
Computer Programming I Levels: 10-12 Units of Credit: 1.0 CIP Code: 11.0201 Core Code: 35-02-00-00-030 Prerequisites: Secondary Math I, Keyboarding Proficiency, Computer Literacy requirement Semester 1
Chapter 2: Elements of Java
Chapter 2: Elements of Java Basic components of a Java program Primitive data types Arithmetic expressions Type casting. The String type (introduction) Basic I/O statements Importing packages. 1 Introduction
Syllabus for CS 134 Java Programming
- Java Programming Syllabus Page 1 Syllabus for CS 134 Java Programming Computer Science Course Catalog 2000-2001: This course is an introduction to objectoriented programming using the Java language.
Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program
Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2014 Jill Seaman
Data Tool Platform SQL Development Tools
Data Tool Platform SQL Development Tools ekapner Contents Setting SQL Development Preferences...5 Execution Plan View Options Preferences...5 General Preferences...5 Label Decorations Preferences...6
SQL Server Database Coding Standards and Guidelines
SQL Server Database Coding Standards and Guidelines http://www.sqlauthority.com Naming Tables: Stored Procs: Triggers: Indexes: Primary Keys: Foreign Keys: Defaults: Columns: General Rules: Rules: Pascal
Lecture 7: Class design for security
Lecture topics Class design for security Visibility of classes, fields, and methods Implications of using inner classes Mutability Design for sending objects across JVMs (serialization) Visibility modifiers
Object Oriented Software Design II
Object Oriented Software Design II Introduction to C++ Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa February 20, 2012 G. Lipari (Scuola Superiore Sant Anna) C++ Intro February
Android Application Development Course Program
Android Application Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive data types, variables, basic operators,
Programming by Contract. Programming by Contract: Motivation. Programming by Contract: Preconditions and Postconditions
COMP209 Object Oriented Programming Designing Classes 2 Mark Hall Programming by Contract (adapted from slides by Mark Utting) Preconditions Postconditions Class invariants Programming by Contract An agreement
www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk
CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling
Java Coding Practices for Improved Application Performance
1 Java Coding Practices for Improved Application Performance Lloyd Hagemo Senior Director Application Infrastructure Management Group Candle Corporation In the beginning, Java became the language of the
To Java SE 8, and Beyond (Plan B)
11-12-13 To Java SE 8, and Beyond (Plan B) Francisco Morero Peyrona EMEA Java Community Leader 8 9...2012 2020? Priorities for the Java Platforms Grow Developer Base Grow Adoption
Chapter 5 Names, Bindings, Type Checking, and Scopes
Chapter 5 Names, Bindings, Type Checking, and Scopes Chapter 5 Topics Introduction Names Variables The Concept of Binding Type Checking Strong Typing Scope Scope and Lifetime Referencing Environments Named
PHP Tutorial From beginner to master
PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies)
Course Name: ADVANCE COURSE IN SOFTWARE DEVELOPMENT (Specialization:.Net Technologies) Duration of Course: 6 Months Fees: Rs. 25,000/- (including Service Tax) Eligibility: B.E./B.Tech., M.Sc.(IT/ computer
Informatica e Sistemi in Tempo Reale
Informatica e Sistemi in Tempo Reale Introduction to C programming Giuseppe Lipari http://retis.sssup.it/~lipari Scuola Superiore Sant Anna Pisa October 25, 2010 G. Lipari (Scuola Superiore Sant Anna)
Software Engineering Techniques
Software Engineering Techniques Low level design issues for programming-in-the-large. Software Quality Design by contract Pre- and post conditions Class invariants Ten do Ten do nots Another type of summary
WA2099 Introduction to Java using RAD 8.0 EVALUATION ONLY. Student Labs. Web Age Solutions Inc.
WA2099 Introduction to Java using RAD 8.0 Student Labs Web Age Solutions Inc. 1 Table of Contents Lab 1 - The HelloWorld Class...3 Lab 2 - Refining The HelloWorld Class...20 Lab 3 - The Arithmetic Class...25
Perl in a nutshell. First CGI Script and Perl. Creating a Link to a Script. print Function. Parsing Data 4/27/2009. First CGI Script and Perl
First CGI Script and Perl Perl in a nutshell Prof. Rasley shebang line tells the operating system where the Perl interpreter is located necessary on UNIX comment line ignored by the Perl interpreter End
Install Java Development Kit (JDK) 1.8 http://www.oracle.com/technetwork/java/javase/downloads/index.html
CS 259: Data Structures with Java Hello World with the IntelliJ IDE Instructor: Joel Castellanos e-mail: joel.unm.edu Web: http://cs.unm.edu/~joel/ Office: Farris Engineering Center 319 8/19/2015 Install
Example of a Java program
Example of a Java program class SomeNumbers static int square (int x) return x*x; public static void main (String[] args) int n=20; if (args.length > 0) // change default n = Integer.parseInt(args[0]);
Japan Communication India Skill Development Center
Japan Communication India Skill Development Center Java Application System Developer Course Detail Track 2b Java Application Software Developer: Phase1 SQL Overview 70 Introduction Database, DB Server
VISUAL GUIDE to. RX Scripting. for Roulette Xtreme - System Designer 2.0
VISUAL GUIDE to RX Scripting for Roulette Xtreme - System Designer 2.0 UX Software - 2009 TABLE OF CONTENTS INTRODUCTION... ii What is this book about?... iii How to use this book... iii Time to start...
core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt
core. 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Volume I - Fundamentals Seventh Edition CAY S. HORSTMANN GARY
Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence
Web Development Owen Sacco ICS2205/ICS2230 Web Intelligence Introduction Client-Side scripting involves using programming technologies to build web pages and applications that are run on the client (i.e.
Basic Programming and PC Skills: Basic Programming and PC Skills:
Texas University Interscholastic League Contest Event: Computer Science The contest challenges high school students to gain an understanding of the significance of computation as well as the details of
Java Coding Style Guide
Java Coding Style Guide Achut Reddy Server Management Tools Group Sun Microsystems, Inc. Created: January 27, 1998 Last modified: May 30, 2000 ABSTRACT The importance and benefits of a consistent coding
Applets, RMI, JDBC Exam Review
Applets, RMI, JDBC Exam Review Sara Sprenkle Announcements Quiz today Project 2 due tomorrow Exam on Thursday Web programming CPM and servlets vs JSPs Sara Sprenkle - CISC370 2 1 Division of Labor Java
Japan Communication India Skill Development Center
Japan Communication India Skill Development Center Java Application System Developer Course Detail Track 2a Java Application Software Developer: Phase1 SQL Overview 70 Introduction Database, DB Server
Java the UML Way: Integrating Object-Oriented Design and Programming
Java the UML Way: Integrating Object-Oriented Design and Programming by Else Lervik and Vegard B. Havdal ISBN 0-470-84386-1 John Wiley & Sons, Ltd. Table of Contents Preface xi 1 Introduction 1 1.1 Preliminaries
Java for WebObjects Developers. Provides a quick-start guide for developers learning to use Java with WebObjects
Java for WebObjects Developers Provides a quick-start guide for developers learning to use Java with WebObjects apple apple Apple Computer, Inc. 2003 All rights reserved under the copyright laws of the
Web development... the server side (of the force)
Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server
Computer Programming C++ Classes and Objects 15 th Lecture
Computer Programming C++ Classes and Objects 15 th Lecture 엄현상 (Eom, Hyeonsang) School of Computer Science and Engineering Seoul National University Copyrights 2013 Eom, Hyeonsang All Rights Reserved Outline
Physical Design. Meeting the needs of the users is the gold standard against which we measure our success in creating a database.
Physical Design Physical Database Design (Defined): Process of producing a description of the implementation of the database on secondary storage; it describes the base relations, file organizations, and
C Compiler Targeting the Java Virtual Machine
C Compiler Targeting the Java Virtual Machine Jack Pien Senior Honors Thesis (Advisor: Javed A. Aslam) Dartmouth College Computer Science Technical Report PCS-TR98-334 May 30, 1998 Abstract One of the
Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff
D80198GC10 Oracle Database 12c SQL and Fundamentals Summary Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff Level Professional Delivery Method Instructor-led
Oracle Database: SQL and PL/SQL Fundamentals
Oracle University Contact Us: 1.800.529.0165 Oracle Database: SQL and PL/SQL Fundamentals Duration: 5 Days What you will learn This course is designed to deliver the fundamentals of SQL and PL/SQL along
