Posts

Showing posts from June, 2011

UML Tutorial

Image
UML Tutorial UML key Points / Notes   1)  Inheritance is indicated by a solid line with a closed,  unfilled  arrowhead pointing at the super class 2) Abstract class is indicated by  italic  notation. 3) By default all the assotiations are bidirectional  this means that both classes are aware of each other and their relationship.   A bi-directional association is indicated by a solid line between the two classes. 4)   A uni-directional association is drawn as a solid line with an open arrowhead (not the closed arrowhead , triangle, used to indicate inheritance) pointing to the known class.  5)  a  dotted  line with a closed, unfilled arrow means  realization  (or implementation)   A very important concept in object-oriented design, inheritance, refers to the ability of one class (child class) to inherit the identical functionality of another class (super class), Inheritance is indicated by a solid line wi...

Code Coverage

Image
============================================== What is EMMA Code coverage. What do you understand by code coverage report? ==============================================                     Code coverage is a measure used in software testing. It describes the degree to which the source code of a program has been tested. To measure how well the program is exercised by a test suite, one or more coverage criteria are used. There are following types of criteria in general.   1) Function coverage - Has each function (or subroutine) in the program been called? 2) Statement coverage - Has each node in the program been executed? 3) Decision coverage   - Has every IF and CASE statements been met as well as not met? 4) Condition coverage - Has each boolean sub-expression evaluated both to true and false?            Attached is Emma-codeCoverage Te...

SingleTon Pattern Nots / Key Points

Some of the key points which I feel one should know. 1) Constructor must be private as nobody should able to create object. 2) getInstance method must be static 3) getInstance method must take care of multiple threads 4) if you make getInstance method as synchronized then it will hamper the performance, Use synchronized block 5) Class should not support serialization, as serialization can create multiple object 6) Class should not be clonable, as cloning can create multiple objects 7) Even if you do synchroniz the piece of code in getInstance() then, still you will have to do double check looking.   in the below code that getInstance method ensures that only one instance of the class is created. The constructor is not accessible from the outside of the class , only way of instantiating the class would be only through the getInstance method. Implementation The implementation involves a static member in the "Singleton" class, a private constructor and a st...

Core Java Notes / Key Points

               HashMap provides constant-time performance for the basic operations (get and put). Iteration over collection views requires time proportional to the "capacity" of the HashMap instance (the number of buckets) plus its size (the number of key-value mappings). Thus, it's very important not to set the initial capacity too high (or the load factor too low) if iteration performance is important. An instance of HashMap has two parameters that affect its performance: initial capacity and load factor. As a general rule, the default load factor (.75) offers a good tradeoff between time and space costs.   =============================== What is the capacity of HashMap =============================== The capacity is the number of buckets in the hash table   =============================== What is loadFactor in HashMap =============================== The load factor is a measure of how full the hash table is allo...

XML-DOM

  ====================================== What is the Document Object Model?  ====================================== The foundation of Extensible Markup Language, or XML, is the DOM. XML documents have a hierarchy of informational units called nodes; DOM is a way of describing those nodes and the relationships between them. A DOM Document is a collection of nodes,the DOM is said to be tree-based , or object-based . provides an API that allows a developer to add, edit, move, or remove nodes at any point on the tree in order to create an application. DOM Level 1 included support for XML 1.0 and HTML Namespace support was added to the DOM Level 2 . new modules supporting Cascading Style Sheets, events, and enhanced tree manipulations. DOM Level 3 , currently in Last Call, includes better support for creating a Document object  XSL Transformations and other XML technologies. CDATA: Short for Character Data, this is a node that contains information that should no...

JSP Short Notes for interview

    Home   ------------------------------------------------------------------------------------------------------------------------- When isThreadSafe is set to true, multiple requests will go to JSP page. This is the default setting. If using true, you must ensure that you properly synchronize access to any shared objects defined at the page level. This includes 1) objects created within declarations 2) JavaBeans components with page scope 3) attributes of the page scope object. If isThreadSafe is set to false, requests are dispatched one at a time. However, you still must ensure that access to attributes of the 1) application or session scope objects 2) JavaBeans components with application or session scope must be properly synchronized.     --------------------------------------------------------------------------------------------------- What are implicit object in jsp 1) request 2) response 3) page 4) session 5) application 6) page...

XML-StAX

Image
======================================================= What are advantages of StAX over SAX and DOM ======================================================= 1) StAX-enabled clients are generally easier to code than SAX clients . StAX parser code can be smaller and the code necessary for the client to interact with the parser simpler. 2) StAX is a bidirectional API, meaning that it can both read and write XML documents . SAX is read only, so another API is needed if you want to write XML documents. 3) SAX is a push API, whereas StAX is pull . ======================================================= What is StAX =======================================================                     The StAX project was  initiated by BEA . The goal of the StAX API is to give "parsing control to the programmer by exposing a simple iterator based API. StAX was created to address limitations in the SAX...