Showing posts with label Remember this. Show all posts
Showing posts with label Remember this. Show all posts

Saturday, January 16, 2010

Points about OOPS

1. Abstraction is the process of highlighting the essential, inherent aspects of an entity while ignoring irrelevant details.
2. Encapsulation (or information hiding) is the process of separating the external aspects of an objects from the internal implementation details which should be hidden from other objects.
3. Modularity is the process of dividing a problem into smaller pieces so that each smaller module can be dealt with individually.
4. Organizing a set of abstractions from most general to least is known as inheritance hierarchy.
5. Object-oriented programming is a paradigm in which a system is modeled as a set of objects that interact with each other.
6. In C++ an abstraction is formed by creating a class. A class encapsulates the attributes and behaviors of an object.
7. The data members of a class represent the attributes of a class. And the member functions of a class represents the behaviors of a class.
8. Polymorphism is the capability of something to assumediferent forms. In an object-oriented language, polymorphism is provided by allowing a message or member function to mean different things depending on the type of object that receives the message.
9. All C++ program begin executing from the main. Function main returns an integer value that indicates whether the program executed successfullly or not. A value of ) indicates successful execution, while the value 1 indicates that a problem or error occurred during the execution of the program.
10. A variable must be defined before it can be used. Smart programmers give a variable an initial value when it is defined.
11. A pointer is a variable whose value is the address of another variable.
12. Pointers should be different type for each type of variable. There are even pointer types whose variable are pointers to other pointers.
13. The location of a variable can be obtained using the address operator &.
14. Pointer operators may be compared using the equality and relational operators.
15. The increment and decrement operators may be applied to pointer objects.
16. Pointers can be passed as reference parameters by using the indirection operator.
17. Command-line parameters are communicated to programs using pointers.
18. We can define variables that are pointers to functions. Such variables are typically used as function parameters. This type of parameter enables the function that uses it to have greater flexibility in accomplishing its task.
19. A reference variable must be initialized when it is declared.
20. When a reference parameter is used, instead of passing a copy of the variable, a reference to the original variable is passed. Any modifications made to the parameter by the called function change the original variable.
21. A reason to use reference parameter is for efficiency. When a class object is passed by value, a copy of the object is passed. If the object is large, making a copy of it can be expensive in terms of execution time and memory space. thus, objects that are large, or objects whose size is not known are often passed by reference. We can ensure that the objects are not modified by using the const modifier.
22. Constructors initialize objects of the class type. It is standard practice to ensure that every object has all of its data members appropriately initializes.
23. A default constructor is a constructor that requires no parameters.
24. A copy constructor initialize a new object to be a duplicate of a previously defined source object. If a class does not define a copy constructor, the compiler automatically supplies version.
25. A class constructor, if defined, is called whenever a program creates an object of that class.
26. An inline function must be defined before it is called.
27. An inline function reduces the function call overhead. Small functions are best declared inline within a class.

Monday, December 21, 2009

Application Vs. Web Server

(1) Webserver serves pages for viewing in web browser, application server provides exposes businness logic for client applications through various protocols.


(2) Webserver exclusively handles http requests.application server serves bussiness logic to application programs through any number of protocols.


(3) Webserver delegation model is fairly simple,when the request comes into the webserver,it simply passes the request to the program best able to handle it(Server side program). It may not support transactions and database connection pooling.


(4) Application server is more capable of dynamic behaviour than webserver. We can also configure application server to work as a webserver.Simply applic! ation server is a superset of webserver.


(5) Web Server serves static HTML pages  or gifs, jpegs, etc., and can also run code written in CGI, JSP etc. A Web server handles the HTTP protocol. Eg of some web server are IIS or apache.


(6) An Application Server is used to run business logic or dynamically generated presentation code. It can either be .NET based or J2EE based (BEA WebLogic Server, IBM WebSphere, JBoss).


(7) A J2EE application server runs servlets and JSPs (infact a part of the app server called web container is responsible for running servlets and JSPs) that are used to create HTML pages dynamically. In addition, J2EE application server can run EJBs - which are used to execute business logic.


(8) An Application server has a 'built-in' web server, in addition to that it supports other modules or features like e-business integration, independent management and security module, portlets etc.

JAVA Vs. DOTNET

# JAVA


  • Java is developed by Sun Microsystems
  • Java is a light weight language and can be run on almost all the OS(it require less hardware)
  • Java you need to confirm it that all the objects are destroyed before application quits.
  • Java has no standard tool is available. Although, many third party IDEs are available
  • Java is a programming language designed to be run on many different platforms, and so uses a common language which has to be compiled and run on different platforms (eg. windows, mac and linux).Any OS which is able to install JVMJava can be used to write programs for many different operating systems
  • Java interface, a null object reference maps to the VT_NULL VARIANT value
  • Java interface, all failure HRESULTs from the underlying COM interface are reported by throwing a com.ca.openroad.COMException containing that HRESULT value




# .NET


  • .Net is developed by Microsoft Corporation
  • .Net needs a very heavy framework to be installed which have higher Hardware requirements too compared to Java
  • .Net garbage collector runs at a certain interval and see is there is any memory occupied by anyobject whose parent is now finished processing (for eg. you closed an application), in this casethe garbage collector automatically removes the reference of that object and free up the memory
  • .Net a standard development IDE is available that is Microsoft Visual Studio
  • .NET, takes on a different approach, by allowing you to program in any language you choose,but has compilers for many different languages that generates a platform specific code (i.e.Microsoft or Windows).
  • .NET can be used to make any programming language into a Windows program.NET COM interoperability layer maps null .NET object references to VT_EMPTY. VT_NULLis mapped to a special object type of class “System.DBNull”.
  • .NET COM interoperability layer does something similar, using theInteropServices.COMException class. However, it uses that exception class only as a lastresort. If there is already a .NET exception class that reasonably represents the meaning of aparticular HRESULT, the interoperability layer throws that .NET exception instead of a COMException.

Saturday, October 03, 2009

Difference between C/C++ and Java

1. A Java string is not implemented as a null-terminated array of characters as it is in C and C++.
2. Most of the Java operators work much the same way as their C/C++ equivalents except for the addition of two new operators, >>> and ^.
3. The comparison operators in Java return a Boolean true or false but not the integer one or zero.
4. The modulo division may be applied to floating point values in Java. This is not permitted in C/C++.
5. The control variable declared in for loop is visible only within the scope of the loop. But in C/C++, it is visible even after the loop is exited.
6. Methods cannot be declared with an explicitly void argument list, as done in C++.
7. Java methods must be defined within the class. Separate definition is not supported.
8. Unlike C/C++, Java checks the range of every subscript and generates an error message when it is violated.
9. Java does not support the destructor function. Instead, it uses the finalize method to restore the memory.
10. Java does not support multiple inheritance.
11. C++ has no equivalent to the finally block of Java.
12. Java is more strictly typed than C/C++ language. For example, in Java, we cannot assign a floating point value to an integer (without explicit type casting).
13. Unlike C/C++ which allows the size of an integer to vary based on the execution environment, Java data type have strictly defined range and does not change with the environment.
14. Java does not support pointers.
15. Java supports labeled break and labeled continue statement.
break has been designed for use only when some sort of special situation occurs. It should not be used to provide the normal means by which a loop is terminated.
16. The use of final to a variable is similar to the use of const in C/C++.
17. Overridden methods in Java are similar to virtual functions in C++.
18. Java does not have a generalized console input method that parallels the scanf in C or cin in C++.
19. Integer types are always signed in Java. There are no unsigned qualifiers.
20. Java does not define escape codes for vertical tab and the bell character.
21. In Java multidimensional arrays are created as arrays. We can define variable size array of arrays.

Thursday, October 01, 2009

Points to remember about Java


1. It is important that the name of the file match the name of the class and the extension be .java.
2. All functions (methods) in Java must be of some class.
3. Member functions are called methods in Java.
4. Creating two methods woth the same name but different arguements is called method overloading.
5. Method overloading allows set to methods with very similar purpose to be given the same name.
6. When a method makes an unqualified reference to another member of the same class, there is an implicit r reference to this object.
7. Java does not provide a default constructor of the class defines a constructor of its own.
8. When present, package must be the first noncomment statement in the file.
9. The import statement must follow the package statment but must also precede all other noncomment statements.
10. The full method or class name, including the package name, must be used when two imported packages contain a method or class with the same name.
11. Due to security reasons, it is not possible to perform file I/O operations from an applet.
12. When a simple type is passed to a method, it is dine by use of call-by-value. Objects are passed by use of call-by-reference.
13. It is illegal to refer to any instance variables inside of a static method.
14. All command-line arguements are passed as strings. We must therefore convert numeric values to their original forms manually.
15. A class member declared as private will remain private to its class. It is not accessible by any code outside its class, including subclasses.
16. The star form of import statement may increase compile time. It will be good practice to explicitly name the classes that we want to use rather than importing whole packages.
17. Interfaces add most of the functionality that is require for many applications which would normally require the use of multiple inheritance in C++.
18. When we implement an interface method, it must be declared as public.
19. If a finally block is associated with a try, the finally will be executed upon conclusion of the try.
20. Java uses pointers (addresses) intenally to store reference to objects, and for elements of any array of objects, However, these pointers are not available for use by programmers.
21. We cannot overload methods with differences only in their return type.
22. When a method with the same signature occurs in both the super class and its subclass, the method in the subclass overrides the method in he super class.
23. Every constructors must invoke its super class constructor in its first statement. Otherwise, the default constructor of the super class will be called.
24. A class marked as final cannot be inherited.
25. A method marked final cannot be overridden.
26. Subclasses of an abstract class that do not provide an implementation of an abstract method, are also abstract.


Search Aptipedia