Thursday, August 25, 2011

Diffrence Between array and Array list


ARRAY

ARRAYLIST
1.
Char[] vowel=new Char[];
ArrayList a_list=new ArrayList();
2.
Array is in the System namespace
ArrayList is in the System.Collections namespace.
3.
The capacity of an Array is fixed
ArrayList can increase and decrease size dynamically
4.
An Array is a collection of similar items
ArrayList can hold item of different types
5.
An Array can have multiple dimensions
 ArrayList always has exactly one dimension



DIFFRENT TYPES OF SQL KEYS


SQL KEYS

Candidate Key - A Candidate Key can be any column or a combination of columns that can qualify as unique key in database

. There can be multiple Candidate Keys in one table. Each Candidate Key can qualify as Primary Key.
Primary Key - A Primary Key is a column or a combination of columns that uniquely identify a record. Only one Candidate Key can be Primary Key.
One needs to be very careful in selecting the Primary Key as an incorrect selection can adversely impact the database architect and future normalization. For a Candidate Key to qualify as a Primary Key, it should be Non-NULL and unique in any domain. I have observed quite often that Primary Keys are seldom changed. I would like to have your feedback on not changing a Primary Key.


Candidate keys->   A candidate key is a combination of
attributes that can be uniquely used to identify a database
record without any extraneous data. Each table may have one
or more candidate keys. One of these candidate keys is
selected as the table primary key.

Alternate keys->   Alternate Key or Unique Key is similar to
PK ,except it accepts null Values .So that the records can
still be entered submitting null values to this attribute.

Composite keys->   compound key (also called a composite key
or concatenated key) is a key that consists of 2 or more
attributes.
         A composite Key can be either Primay or Unique
Key.More then One Key columns are said to be composite keys

OOPS CONCEPTS


Encapsulation: A simple definition of encapsulation is - combining the data (information) and the methods (functions) that can manipulate that data into one capsule (class/object). Depending on how you write program encapsulation, it guarantees that the encapsulated data is not accessed by any other function/method/program outside the encapsulated object. For example,
class MyCapsule
{
private:
int myInt;
char myChar;
public:
MyIntFunc() { myInt = 10; }
MyCharFunc() { myChar = 'A'};
};

In this case, no other program/function/method can access myInt other than MyIntFunc. Same is true for myChar and MyCharFunc.

Abstraction: A simple definition of abstraction is to hide actual implementation of an object from the external world that would use the object. For example, a program that is drawing circles and squares using those objects need not know how those objects are implemented. It is enough for the program to know what the behavior of these objects is, and how to use these objects (rather than how these objects are implemented internally).

So, drawing a parallel between abstraction and encapsulation, when you encapsulate data and methods that operate on data into one object, the external program that uses this object need not know the internal workings of the object to use the object. Thus making the object abstract data type to the external program. Classic examples of abstract data type in C (yes) are int, char, float, double etc. Classes are OOPL variations and extensions of the traditional abstract data types.
------------------------------                      

OOP with VB

OOP Basics
Visual Basic was Object-Based, Visual Basic .NET is Object-Oriented, which means that it's a true Object-Oriented Programming Language. Visual Basic .NET supports all the key OOP features like Polymorphism, Inheritance, Abstraction and Encapsulation. It's worth having a brief overview of OOP before starting OOP with VB.
Why Object Oriented approach?

A major factor in the invention of Object-Oriented approach is to remove some of the flaws encountered with the procedural approach. In OOP, data is treated as a critical element and does not allow it to flow freely. It bounds data closely to the functions that operate on it and protects it from accidental modification from outside functions. OOP allows decomposition of a problem into a number of entities called objects and then builds data and functions around these objects. A major advantage of OOP is code reusability.

Some important features of Object Oriented programming are as follows:

     Emphasis on data rather than procedure
     Programs are divided into Objects
     Data is hidden and cannot be accessed by external functions
     Objects can communicate with each other through functions
     New data and functions can be easily added whenever necessary
     Follows bottom-up approach
Concepts of OOP:
     Objects
     Classes
     Data Abstraction and Encapsulation
     Inheritance
     Polymorphism
Briefly on Concepts:

Objects

Objects are the basic run-time entities in an object-oriented system. Programming problem is analyzed in terms of objects and nature of communication between them. When a program is executed, objects interact with each other by sending messages. Different objects can also interact with each other without knowing the details of their data or code.

Classes

A class is a collection of objects of similar type. Once a class is defined, any number of objects can be created which belong to that class.

Data Abstraction and Encapsulation

Abstraction refers to the act of representing essential features without including the background details or explanations. Classes use the concept of abstraction and are defined as a list of abstract attributes.

Storing data and functions in a single unit (class) is encapsulation. Data cannot be accessible to the outside world and only those functions which are stored in the class can access it.

Inheritance

Inheritance is the process by which objects can acquire the properties of objects of other class. In OOP, inheritance provides reusability, like, adding additional features to an existing class without modifying it. This is achieved by deriving a new class from the existing one. The new class will have combined features of both the classes.

Polymorphism

Polymorphism means the ability to take more than one form. An operation may exhibit different behaviors in different instances. The behavior depends on the data types used in the operation. Polymorphism is extensively used in implementing Inheritance.

Advantages of OOP

Object-Oriented Programming has the following advantages over conventional approaches:
     OOP provides a clear modular structure for programs which makes it good for defining abstract datatypes where implementation details are hidden and the unit has a clearly defined interface.
     OOP makes it easy to maintain and modify existing code as new objects can be created with small differences to existing ones.
     OOP provides a good framework for code libraries where supplied software components can be easily adapted and modified by the programmer. This is particularly useful for developing graphical user interfaces.

Differences Between SQL Server 2000 and SQL Server 2005


1          UI Differences -Tools *Analysis Services Manager (ASM)

*Query Analyzer (QA)

*Enterprise Manager (EM)

*Report Manager
            *Business Intelligence Development Studio (BIDS)

*SQL Server Management Studio (SSMS)  
2          UI Differences -Organizing Grain
            *ASM "Database"       *BIDS "Solution"and "Project"
           
3          UI Differences - Data Modeling          *Must be connected to do anything

*Single Data Source, Single Fact Table per Cube

*Cannot directly rename entities -must resort to database views to rename entities and for logical abstraction

*Must resort to virtual cubes for mixed fact granularity

*No support for arbitrary SQL as a Data Source
            *Data Source Views (DSVs) provide an abstraction layer

*Between Database and Cubes, DSV can contain tables drawn from multiple heterogeneous

*In data source , once DSV established, need not be connected to work with cube models

*Can rename entities, provide annotations

*Named Queries -arbitrary SQL as Data Source

*DSVs can be shared between cubes and DTS for improved consistency and administration
           
4          UI Differences -Cube Construction    *Manually intensive, even with Wizard

*Must know the underlying schema well
            *Intellicube     
5          UI Differences -Deployment  *Archive/Restore Database
*CAB files
*No configuration variables for Data Source connectivity, etc.
            *Elaborate Configuration and Deployment Model
           
6          UI Differences - Metadata Storage
            *There isa repository

*Defaults to Access -can upgrade to SQL Server

*Cannot really be source-controlled
            *There is not a repository

*Metadata stored in XML documents, can easily be source-controlled

*Team development is facilitated
           
7          Architecture -Unified Dimensional Model
            *Distinct difference between flat file, relational, cube and web-service data sources
            *Unified Dimensional Model (UDM) integrates all types of data sources -data consumer sees single, multi-dimensional interface

*Allows the user model to be greatly enriched

*Provides high performance queries supporting interactive analysis, even over huge data volumes

*Allows business rules to be captured in the model to support richer analysis

*Supports writeback and 'closing the loop'
           
8          Architecture –Dimensions
            *Role-playing requires multiple Dimensions
            *Role-playing is a new Dimension type

*Reference Dimension

*Many-to-many Dimension
           
9          Architecture –Hierarchies       *One and only one Hierarchy per Dimension

*Attributes are either part of Hierarchy or are Properties
            *Zero to multiple Hierarchies in same Dimension

Feature
SQL Server 2000
SQL Server 2005
Security
Owner = Schema, hard to remove old users at times
Schema is separate. Better granularity in easily controlling security. Logins can be authenticated by certificates.
Encryption
No options built in, expensive third party options with proprietary skills required to implement properly.
Encryption and key management build in.
High Availability
Clustering or Log Shipping require Enterprise Edition. Expensive hardware.
Clustering, Database Mirroring or Log Shipping available in Standard Edition. Database Mirroring can use cheap hardware.
Scalability
Limited to 2GB, 4CPUs in Standard Edition. Limited 64-bit support.
4 CPU, no RAM limit in Standard Edition. More 64-bit options offer chances for consolidation.