Thursday, December 31, 2015

What is the Difference between ArrayList and List Class?

ArrayList is a non-generic collection class and resides in System.Collection namespace whereas List is a generic class and resides in System.Collections.Generic namespace

Background

This is one of my favorite interview questions. This question helps me to find out if candidate has good knowledge of generics or not. On the internet, there are a number of writeups on "difference between Arrayand ArrayList" but I didn't find any on "difference between ArrayList and List", so I am posting one...

Must Know

First, one should know what is upcasting? Upcasting is converting derived type into base type. In .NET, all data-types are derived from Object. So we can typecast any type to Object type. For example, if Customer is class, then we can create object of Customer like this:
Object cust = new Customer()
Here new Customer() will create object on heap and its address we are putting in reference variable of typeObject.

ArrayList

ArrayList marks = new ArrayList();
marks.Add(50);
marks.Add(70.5);
marks.Add("Sixty");
In the above code snippet, we are creating object of ArrayList and adding different type of data in it. But actually ArrayList is a collection of Object type, and when we add any item to ArrayList, it first convertsit to object type (upcasting) and then adds it to collection object.
Interesting Fact: As ArrayList can only create collection for Object type, it is said to be non-generic class. It might be confusing as it seems that we can add any datatype value like intfloatstring to ArrayListcollection so in that sense it should be called as generic class. But in fact, it internally converts all thesedatatypes in object type and then adds to collection.
We can visualise it as:

List

List<int> marks = new List<int>();

marks.Add(50);
marks.Add(70);
marks.Add(60);
In the above snippet, we can observe that while creating object of list class, we have mentioned datatype of collection we want to create. We need to pass datatype while creating object as List class doesn’t hard code it internally. So the above declaration will create marks as collection of integers; and not collection of objects as in case of ArrayList.
We can visualize it as:

Interesting fact: In the above collection “marks” you can only add integers and no other type. In that sense, it should be referred to as non-generic! But wait, using the same List class, you can also create collection ofstring type:
List<string> names = new List<string>();
Or even you can create collection of custom types. For example, collection of Student type can be created as:
List<Student> students = new List<Student>(); 
And as using same List class, now you are able to create collection of any data-type as integers, strings or students; this class is known as Generic class.
One of the benefits of using generic collection is no need of boxing and unboxing while tackling with collections of value types.
We can visualise List of string type (or any ref type) as:

Monday, October 7, 2013

Sql Tables Types

SQL Server Basics: How to Create Different Type of Tables

Most of the time we forget to write for beginners or who occasionally use SQL Server. Possibility its because we just want to pressurize others with our knowledge and resultantly we don't like to write for simple topic targeting beginners.

Today we will discuss about different types of tables, which can be created for different purposes.

Regular User Tables
Regular user table is the actually table which holds data of user for later on processing and reporting purpose. These are also called physical tables at they physically resides at hard drive until you DROP them intentionally.

CREATE TABLE [dbo].[TestTable]
    (
      [TestTableID] [int] NOT NULL,
      [FirstCol] [varchar](200) NULL,
      [SecondCol] [int] NULL
    )
ON  [PRIMARY] --  This part indicates, where (Database FileGroup) table will be created physically


Temporary Tables
Temporary tables and created to hold temporary data regarding intermediate results of different quires. These tables will be drooped automatically once the store procedure is executed (if they are used in stored procedure) or once the session is over. But as good programming practice will must drop these tables once they are not required.

CREATE TABLE #Temp_TestTable
    (
      [TestTableID] [int] NOT NULL,
      [FirstCol] [varchar](200) NULL,
      [SecondCol] [int] NULL
    )
   
GO
-- DROP TABLE #Temp_TestTable --(Drop temporary table when not required)     
GO

Global Temporary Tables
These are just like simple temporary tables but are available to all sessions and will only be dropped automatically when last session of database will be closed. If single session is active, global temporary tables will remain available.

CREATE TABLE ##GTemp_TestTable
    (
      [TestTableID] [int] NOT NULL,
      [FirstCol] [varchar](200) NULL,
      [SecondCol] [int] NULL
    )

GO
-- DROP TABLE ##GTemp_TestTable      
--(Drop global temporary table when not required)

These were three types of tables that can be created in SQL Server. Lets talk about some tricks about tables.

Tables Cloning
Existing regular, temporary or global temporary tables can be cloned (structure as well as their data). Following statement will create a new table, exactly same in structure to existing one.
SELECT  *
INTO    [dbo].[NewTestTable]
FROM    [dbo].[TestTable]
WHERE   1 = 2     -- Remove WHERE clause if you want to copy both structure and data


Inserting Data On Basis of Stored Procedure Result
Table can be populated with data from result set of stored procedure. Table variables can not be populated in this fashion.
INSERT INTO [YourTableName](CommaSeparatedColumnsName)
 EXECUTE YourStoredProcedureNameHere CommaSeparatedParameterValues

Table Variables
Table variables are just like scalar variables which possess structure of a table and can hold records for intermediate results of different quires. These are the best alternative for temporary tables as there is no need to worry about demolition of table variables after use.

DECLARE @VarTestTable TABLE
(
      [TestTableID] [int] NOT NULL,
      [FirstCol] [varchar](200) NULL,
      [SecondCol] [int] NULL
)

To Split Data in SQL Server

INNER JOIN (SELECT number FROM master.dbo.spt_values WHERE (type = 'P')) AS Numbers1(n1)  
ON LEN(Alertusers.RightsID) + 1 > Numbers1.n1 
INNER JOIN <Tablename1> ON SUBSTRING(<ColumnName.RightsID, Numbers1.n1, CHARINDEX(',', ColumnName.RightsID + ',', Numbers1.n1) - Numbers1.n1) =ColumnName .AlertID 
where ColumnName<>'' and ColumnName='Yes'  and TableName.Email <>''


Above function using to Split the one column data to Each single column using with ,(comma)

Like

  Name              Address              city
Karthikeyan     Kallakurichi        Chennai,Salem

To
  Name              Address              city
Karthikeyan   Kallakurichi     Chennai
Karthikeyan   Kallakurichi     Salem

 

Thursday, January 31, 2013

Delete Particular Row from Datatable in C# | Delete Selected Row From DataTable in Asp.net

C# Code

DataTable dt1 = new DataTable();
dt1 = ds.Tables[0];
for (int i = 0; i < dt.Columns.Count;i++ )
{
if (i == 3)
{
dt.Rows[i - 1].Delete();
dt.AcceptChanges();
}
}

Thursday, January 3, 2013

Walkin interviews

Today's Topic Summary
Group: http://groups.google.com/group/technicaljobopenings/topics
    "Dakhare, Sandip" <sandip.dakhare@capgemini.com> Jan 02 12:29PM +0530

    _______________________________________________________________________
    [cid:image005.jpg@01CDE8E4.DA0FF9C0] SANDIP DAKHARE
    Capgemini India | Mumbai
    www.capgemini.com<http://www.capgemini.com/>
    Email Id.: sandip.dakhare@capgemini.com
    People matter, results count.
    _______________________________________________________________________





    From: IN, Friends like you
    Sent: Monday, December 31, 2012 4:28 PM
    To: DL IN ALL
    Subject: Walk-in Drive For Business Intelligence Professionals at Capgemini Chennai on January 5, 2013 - Refer Now


    - This is a walk-in drive. No separate email will be sent or call made to your referrals. Eligible candidates should walk in to the venue directly.

    - Uploading of CVs on http://friendslikeyou.in.capgemini.com is necessary for Referral bonus.

    - If you are unable to upload CVs, please write to the IN, Friends Like You<mailto:associatereferral.fssbu@capgemini.com> team with the subject line, "Upload Problem" and include the name of the candidate, e-mail ID, date of birth and primary skill details.

    - Profiles that have exceeded the validity period of six months will not be considered as valid referrals. Kindly contact the Friends Like You team to update CVs.


    [cid:image001.jpg@01CDE76D.5C147AF0]









    Job ID

    Profile

    Exp.

    Job Location

    Interview Location

    35424

    SAS BI/DI Developer / SAS Analyst

    2.5-8 yrs

    Chennai/ Mumbai/ Bangalore

    Chennai

    35417

    Teradata Developer

    3-8 yrs

    Chennai/Bangalore/Hyderabad
    Mumbai/Pune/Kolkata/Gurgaon

    35413

    Informatica Developer

    3-8 yrs

    Chennai/ Bangalore/Mumbai/ Kolkata /Gurgaon







    Date/ Day/ Time

    Drive Location (Chennai)

    Contact

    January 5, 2013

    Saturday

    10 am - 3 pm

    Capgemini India Pvt. Ltd.

    1st Floor FDC, Anna Salai
    Teynampet, Chennai.

    Sneha More



    It is mandatory for candidates to carry the following documents while visiting the venue:


    § Hardcopy of the updated CV

    § Previous/current employers employment documents

    § Latest two pay slips

    § Two Passport size photograph

    § Photo ID proof and Company ID proof





    · To get the Referral ID and for detailed role description, please log on to http://FriendsLikeYou.in.capgemini.com






    · Please upload all CVs on the Referral Site against the job IDs mentioned above










    [cid:image003.jpg@01CDE76D.5C147AF0]


    This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
    "Dakhare, Sandip" <sandip.dakhare@capgemini.com> Jan 02 12:29PM +0530

    _______________________________________________________________________
    [cid:image005.jpg@01CDE8E4.CB13C370] SANDIP DAKHARE
    Capgemini India | Mumbai
    www.capgemini.com<http://www.capgemini.com/>
    Email Id.: sandip.dakhare@capgemini.com
    People matter, results count.
    _______________________________________________________________________





    From: IN, Friends like you
    Sent: Monday, December 31, 2012 1:11 PM
    To: DL IN ALL
    Subject: Immediate Positions with Capgemini - Refer Now


    - Uploading of CVs on http://friendslikeyou.in.capgemini.com is necessary for Referral bonus.

    - If you are unable to upload CVs, please write to the IN, Friends Like You<mailto:associatereferral.fssbu@capgemini.com> team with the subject line, "Upload Problem" and include the name of the candidate,
    e-mail ID, date of birth and primary skill details.

    - Profiles that have exceeded the validity period of six months will not be considered as valid referrals. Kindly contact the Friends Like You team to update CVs.

    - For profiles already uploaded and in the ownership period of six months, please send the resumes with referral ID to the mentioned POCs in the mail


    [cid:image001.jpg@01CDDF8B.7A66FB70]





    Job ID

    Profile

    Exp.

    Job Location

    Contact

    35395

    Teradata Data Modeler

    6-10 yrs

    Bangalore / Mumbai / Hyderabad / Chennai / Kolkata / Pune & Gurgaon

    Namita Gholap

    35396

    Teradata Architect

    8-12 yrs

    35378

    Oracle Apps Warehouse Management Functional

    4-8 yrs

    Bangalore

    Ruta Subhedar

    35377

    Oracle Apps Project Accounting Functional

    4-8 yrs

    Bangalore

    35376

    Oracle Apps iRecruitment Functional

    4-8 yrs

    Bangalore

    35388

    Oracle Apps ASCP Functional

    4-8 yrs

    Bangalore

    35061

    Dataflux Developer

    2.5-5 yrs

    Bangalore

    Sheetal Hatagale

    33975

    SAP Solution Manager

    4-8 yrs

    Mumbai/ Bangalore

    Nilasha Pawar
















    * For detailed description please log on to - http://FriendsLikeYou.in.capgemini.com






    * Please upload all resumes on the Referral Site against the job IDs mentioned above






    * You can direct the relevant and already uploaded profiles to the appropriate points of contact by indicating in the subject line the candidate's name, his/her referral ID, years of experience and the job title




    [cid:image003.jpg@01CDDF8B.7A66FB70]



    This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
    "Dakhare, Sandip" <sandip.dakhare@capgemini.com> Jan 02 01:21PM +0530

    _______________________________________________________________________
    [cid:image002.jpg@01CDE8EC.1E46E160] SANDIP DAKHARE
    Capgemini India | Mumbai
    www.capgemini.com<http://www.capgemini.com/>
    Email Id.: sandip.dakhare@capgemini.com
    People matter, results count.
    _______________________________________________________________________





    From: IN, Friends like you
    Sent: Wednesday, January 02, 2013 1:12 PM
    To: DL IN ALL
    Subject: Walk-in Drive For .NET Professionals at Capgemini Hyderabad, Chennai & Pune on January 5 & 6, 2013 - Refer Now


    - This is a walk-in drive. No separate email will be sent or call made to your referrals. Eligible candidates should walk in to the venue directly.

    - Uploading of CVs on http://friendslikeyou.in.capgemini.com is necessary for Referral bonus.

    - If you are unable to upload CVs, please write to the IN, Friends Like You<mailto:associatereferral.fssbu@capgemini.com> team with the subject line, "Upload Problem" and include the name of the candidate, e-mail ID, date of birth and primary skill details.

    - Profiles that have exceeded the validity period of six months will not be considered as valid referrals. Kindly contact the Friends Like You team to update CVs.


    [cid:image008.jpg@01CDE8E5.CAB162B0]









    Job ID

    Profile

    Exp.

    Job Location

    Interview Location

    35406

    Microsoft .NET Developer/ Lead

    3-8 yrs

    Pune/ Chennai/ Hyderabad

    Pune/ Chennai/ Hyderabad







    Date/ Day/ Time

    Drive Location (Hyderabad)

    Contact

    January 5 & 6, 2013

    Saturday & Sunday

    9:30 am - 4:00 pm

    Capgemini India Pvt. Ltd.

    Survey # 115/ 32 & 35, Manikonda Village, Nanakramguda, Gachibowli, Hyderabad.


    Sarada Kandanuri

    Drive Location (Chennai)

    Contact

    Capgemini India Pvt. Ltd.

    455 Anna Salai, Teynampet, Chennai.


    Akbar Syed

    Drive Location (Pune)

    Contact

    Capgemini India Pvt. Ltd.

    1st Floor, B-1, Cerebrum IT Park, Kalyani Nagar, Pune.


    Neha Misra



    It is mandatory for candidates to carry the following documents while visiting the venue:


    § Hardcopy of the updated CV

    § Previous/current employers employment documents

    § Latest two pay slips

    § Two Passport size photograph

    § Photo ID proof and Company ID proof





    · To get the Referral ID and for detailed role description, please log on to http://FriendsLikeYou.in.capgemini.com






    · Please upload all CVs on the Referral Site against the job IDs mentioned above










    [cid:image010.jpg@01CDE8E5.CAB162B0]


    This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 10:08AM +0530

    *Salary Offered: *2,20,000 pa

    **

    *Qualification:*BE/BTECH/MCA/MSC Graduates

    *Job Role:* Software Engineering Trainee

    *Year of Passing*: 2011/2012 Fresh Graduates with an aggregate of 70% and
    above

    *Skills:* Good programming skills in C/C++, software engineering processes,
    databases,

    *Job Type:* Regular Full Time

    *Posting Locations:* Chennai

    *Experience:* Fresh Graduates only

    *Event Date:* Will be communicated to shortlisted candidates


    More Details Click Below link:

    http://www.carevoyant.com/careers_freshers_recruitment.aspx
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:59AM +0530

    Dear.,

    Urgent Opening for "CA Professional"
    Manufacturing Company Looking for CA Professional
    Post Qualified CA 2-4yrs Exp In Manufacturing Company
    Accounts & Audits
    Location: Hyderabad

    Refer your friends if Suitable

    Thanks & Regards
    Anuradha
    Gobrah
    040 64647088
    E Mail: anuradha@gobrah.com
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:59AM +0530

    Dear.,

    Mid level Company Looking for “Dot net Team Lead”

    Location: Hyderabad

    Experience: 3.6-5yrs

    Deep knowledge of the .NET 3.5/4.0 Framework, including Visual Studio
    2008, ASP.NET, C#, Silver Light
    WCF Web Services and ADO.NET.
    Strong experience working with n-tier architectures (UI, Business Logic
    Layer,
    Data Access Layer) along with some experience with service-oriented
    architectures (SOA).
    Ability to write and optimize SQL Server 2008 stored procedures.
    Strong knowledge of software implementation best practices.
    Ability to adapt quickly to an existing, complex environment.
    Ability to quickly learn new concepts and software is necessary.
    Candidate should be a self-motivated, independent, detail oriented,
    responsible team-player


    Refer If any friends suitable...

    Thanks & Regards
    Anuradha
    Gobrah
    040 64647088
    E Mail: anuradha@gobrah.com
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:57AM +0530

    Greetings,

    Hope you are doing good...

    This is Prem Kumar, IT Recruiter from Volen Software - Consulting firm,
    Bangalore, India

    We have excellent opening for Java, J2ee experts for Contract position with
    our client - Bangalore Location

    Company -Will be disclosed later
    Designation - Java, J2ee
    Yrs of Experience - 4 - 5 Yrs
    Location - Bangalore
    Position - Contract
    Required Notice Period - 30 Days

    Job Description:
    Mandatory:
    4-5 Yrs exposure in Java, J2EE, Struts, JSP, Servlets, Hibernate.
    *Must have experience in JavaScript/jQuery/ JavaScript libraries/AJAX.
    *Must have Strong SQL skills and relational database knowledge
    *The candidate should be able to code/develop an application in Java, J2EE,
    Spring, Hibernate technology using a design specification.
    *Experience on Server side Technologies such as JDBC, JMS and Web-Services.
    *Candidates with knowledge of Ant/Maven will be preferred

    If this Opportunity grab Your interest then revert back Your Updated
    Profile ASAP to:premkumar@volensoftware.com with the following detials:

    Total Experience :
    Relevant Experience :
    Highest Qualification :
    Current Company : h
    Current Position : Permanent / Contract :
    Current Location :
    Current CTC :
    Expected CTC :
    Notice Period :
    Reason for Job Change:

    Awaiting for your early response!!!!!!!!!!!!!!!!!!!!!

    With Warm Regards,
    Prem Kumar TK
    IT Recruiter
    Volen Software Services Pvt Ltd.
    Work Tel: 080-40574474
    Email - premkumar@volensoftware.com | www.volensoftware.com
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:56AM +0530

    Position: Secretary to HEAD-HR (only male candidate)
    Job Location: Secunderabad
    Salary Range Rs. (3.5 to 4) Lacs/annum
    Qualification: MBA-HR / Degree (English Medium)

    Skills:
    Preferably with good* *Presentable and **Excellent communication skills in
    English,Hindi&Telugu languages .
    Internet savvy, Good written, oral communication & strong interpersonal
    skills

    For more details you may call@+91-9550000466
    or
    Write to krish@jobshub.in with Subject line as :+6 yrs exp (Secretary for
    HEAD-HR) position

    Thank you
    Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:50AM +0530

    Mail Your Resumes to: Sudhakar Reddy <bsreddy.gdr@gmail.com>



    Hi,

    Please find the openings in Our Company. Refer your firends, whose profiles
    matches to below requirements ...
    Site Reliability Engineer

    *Experience Range : 4 + yrs
    *

    *Resposibilites: *

    - Ensuring site is 24*7:Reliable monitoring design
    - Architecting deployment methods that assist 24*7 uptime(Zero down time
    deployment methods)
    - Time to time capacity reviews of the system
    - Collaborate with engineering and operational teams to architect and
    develop tools to assist operations

    *Requirements:*

    - BTECH/MTECH in CS from an reputed Engineering College
    - Hands on Linux knowledge(system and Networking)
    - Proficient in a scripting language(Preferably in Ruby)
    - Deep knowledge of JVM profiling techniques
    - Must have deep understanding of building and managing large scale web
    infrastructure, Load balancing
    - Prior proven experience in handling large web sites
    - Good Experience in Core Java
    - Experience in developing tools to run site operations
    - Preferable knowledge of My SQL tuning
    - Familiarity with apache,tomcat,activeMQ and HTTP tuning techniques
    - Exposure to new No-SQL infrastructures like HBase etc an added plus .



    Business Analysts

    *Qualification Required and Preferred*

    - Bachelors or Masters degree preferred in Computer Science or related
    technical field


    - At least 4 years experience as an IT Business Analyst / Business
    Systems Analyst
    - Analysis and functional design experience in financial products like
    core banking, payments, credit/debit cards, accounting products
    - Engineering background is preferred so that functional system
    solutions can be provided to business problems
    - Excellent oral communication, organisational and analytical skills,
    very high attention to detail
    - Ability to build effective working relationships internally and with
    clients.

    *Role and Responsibilites*



    As a Business Analyst, you will work with the Product Manager to help
    achieve the goals of delivering a financial payment products platform,
    which will cater to our customers around the world.

    - Elicit requirements by stakeholder interviews, requirements workshops,
    JAD sessions, business processes, use cases, scenarios, business analysis,
    workflow analysis
    - Conduct and Lead JAD sessions
    - Reconcile information conflict from multiple sources, decompose
    high-level information into details, remove ambiguity, ensure integrity of
    software requirements
    - Challenge business users / stakeholders, as required, on their
    assumptions of how they will use features and functionality to meet end
    user needs
    - Separate user requests from the underlying true needs
    - Translate & document business needs into detailed functional
    requirements and maintain a use case ecosystem
    - Define detailed use cases, swim lane activity diagrams [As-Is and
    To-Be], sequence diagrams and other necessary requirements documentation
    - Perform Gap analysis
    - Ensure reusability, generalisation and extensibility principles at use
    case level
    - Partner with other Business Analysts and teams to ensure that system
    artefacts are reused and not re-built.
    - Proactively communicate and collaborate with external and internal
    customers to analyse and deliver project artefacts like Functional &
    Non-Functional requirements, Requirements Document, Use Cases, screen
    mock-ups and API definitions
    - Create Requirements Traceability Matrix
    - Document detailed Functional Design document
    - Help in the preparation of Technical Design Document(s) as required
    - Understand interface points for the all the systems within the
    platform or product family
    - Make recommendations on product initiatives
    - Support the Product Managers to define product vision and strategy
    - Evaluate feature-wise feasibility, acceptance & risk
    - Participate in logical & technical Design as required
    - Conduct Functional Design walkthroughs for Dev and QA
    - Work with the QA team to ensure test coverage of requirements
    - Review & certify test plans, test scenarios and test cases for
    completeness
    - Define strategy, test plan, test scenarios for UAT and coordinate with
    end users and conduct UAT
    - Make trade-off decisions between feature scope and schedule, without
    compromising the effectiveness of the solution
    - Provide analysis and functional design task estimates for project
    planning
    - Participate in peer reviews of team deliverables as required
    - Escalate potential problems and risks to the management team.

    *Skill Requirement*



    - Hands-on and proven ability to use analysis and design tools like
    Enterprise Architect, IBM Rational tools, TIBCO Business Studio, CaliberRM
    or any other CASE tools
    - Advanced skill level in UML 2.0, BPMN or any other standard modelling
    language
    - Expert level skills in MS Office suite products (Word, Excel,
    PowerPoint, Visio)
    - Experience working within methodologies like Unified Process/Agile
    preferred



    Automation Engineers

    *Experience Required - 3-5 yrs*

    *Role and Resposibilities:*

    - Expert Automation Engineer with Selenium Web driver work experience
    - Candidate should be able to independently design and automate the end
    to end scenarios/manual test cases using selenium web driver.
    - Develop,maintain and execute automated test scripts and generate test
    reports.
    - Identify manual tests that can be converted into automation test
    scripts and segregate them for regression/sanity testing.
    - Candidate should support various teams on automation implementation
    using different frameworks and interact with different teams to gain
    knowledge on the application features.
    - Assisting where needed to support users and customers with issues or
    problems in functional automation
    - Continually build knowledge and proficiency on Functional testing
    tools and learn any change sin technology/updates regarding tools.
    - Working conditions will be employed in India , Hyderabad and will be
    part of Shared QA-Functional Automation team .

    *Skills Required ::*

    *Primary Skills ::*

    - Knowledge Automation Framework Design
    - Knowledge of any programming language /development background.
    - Good experience in API Testing/Selenium

    *Secondary Skills:*

    - Good to have knowledge of test environment set up and build deployments
    - Knowledge of banking and financial products are plus .
Technical Jobs <technicaljobopenings@gmail.com> Jan 03 09:45AM +0530

**

*From:* BR India General Announcement
*Sent:* Wednesday, January 02, 2013 2:04 PM
*To:* BR India Associates (HYD)
*Subject:* Aamantran Walk-In - Jan 5th (10 AM to 1 PM) - Java/J2EE (Exp : 3
to 8 Years)****

** **

* *

*The following message is being forwarded on behalf of team HR.*

*Please do not reply to this mail as it comes from an unattended mailbox. *

** **

[image: Aamantran Java 5 January 2013.gif]****

WCF Step by Step Tutorial

WCF Step by Step Tutorial

1. Basics of WCF
2. Download – Source Code
3. Download WCF Tutorial – PDF document
Basics of WCF
Definition of WCF 
Windows Communication Foundation (WCF) is a framework for building service-oriented applications. Using WCF we can build secure, reliable, transacted solutions that integrate across platforms.

WCF is a unified framework which provides :
1. NET Remoting 2.Distributed Transactions 3.Message Queues and 4.Web Services into a single service-oriented programming model for distributed computing.
WCF interoperate between WCF-based applications and any other processes that communicate via SOAP (Simple Object Access Protocol) messages.
Features of WCF
  1. Service Orientation
  2. Interoperability
  3. Multiple Message Patterns
  4. Service Metadata
  5. Data Contracts
  6. Security
  7. Multiple Transports and Encodings
  8. Reliable and Queued Messages
  9. Durable Messages
  10. Transactions
  11. AJAX and REST Support
  12. Extensibility
To know more about features of WCF see: http://msdn.microsoft.com/en-us/library/ms733103.aspx
Terms of WCF
A WCF service is exposed to the outside world as a collection of endpoints.
1. Endpoint: Endpoint is a construct at which messages are sent or received (or both). Endpoint comprises of ABC’s       
What are ABC’s of WCF ? 
A. Address - Address is a location that defines where messages can be sent
B. Binding - Binding is a specification of the communication mechanism (a binding) that described how messages should be sent
C. Contract - Contract is a definition for a set of messages that can be sent or received (or both) at that location (a service contract) that describes what message can be sent.
2. Service: A construct that exposes one or more endpoints, with each endpoint exposing one or more service operations.
3. Contracts: A contract is a agreement between two or more parties for common understanding and it is a is a platform-neutral and standard way of describing what the service does. In WCF, all services expose contracts.
Types of Contracts:
1) Operation Contract: An operation contract defines the parameters and return type of an operation.
1[OperationContract]
2double Add(double i, double j);
2) Service Contract: Ties together multiple related operations contracts into a single functional unit.
01[ServiceContract] //System.ServiceModel
02public interface IMath
03{
04    [OperationContract]
05    double Add(double i, double j);
06    [OperationContract]
07    double Sub(double i, double j);
08    [OperationContract]
09    Complex AddComplexNo(Complex i, Complex j);
10    [OperationContract]
11    Complex SubComplexNo(Complex i, Complex j);
12}
3) Data Contract: The descriptions in metadata of the data types that a service uses.
01// Use a data contract
02[DataContract] //using System.Runtime.Serialization
03public class Complex
04{
05    private int real;
06    private int imaginary;
07 
08    [DataMember]
09    public int Real { get; set; }
10 
11    [DataMember]
12    public int Imaginary { get; set; }
13}

WCF Step by Step Tutorial


This is the Basic WCF Tutorial ‘wcfMathSerLib’ will be created in a step by step approach. This ‘wcfMathSerLib’ will be tested by ‘ConsoleMathClient’ and with ‘WCF Test Client’
Steps for creating wcfMathSerLib
1. Open Visual Studio 2010 and File->NewProject
2.select WCF in ‘Recent Templates’
3.select ‘WCF Service Library’
4.Give Name as wcfMathServiceLibrary
5.Click OK
Image(1)
2. Delete IService1.cs and Service1.cs
Image(2)
3. Add IMath.cs and MathService.cs and add the code listed below
Image(3)
IMath.cs
01using System.Runtime.Serialization;
02using System.ServiceModel;
03 
04namespace WcfMathServLib
05{
06    [ServiceContract] //System.ServiceModel
07    public interface IMath
08    {
09        [OperationContract]
10        double Add(double i, double j);
11        [OperationContract]
12        double Sub(double i, double j);
13        [OperationContract]
14        Complex AddComplexNo(Complex i, Complex j);
15        [OperationContract]
16        Complex SubComplexNo(Complex i, Complex j);
17    }
18 
19    // Use a data contract
20    [DataContract] //using System.Runtime.Serialization
21    public class Complex
22    {
23        private int real;
24        private int imaginary;
25 
26        [DataMember]
27        public int Real { get; set; }
28 
29        [DataMember]
30        public int Imaginary { get; set; }
31    }
32}
MathService.cs
01namespace WcfMathServLib
02{
03    public class MathService : IMath
04    {
05 
06        public double Add(double i, double j)
07        {
08            return (i + j);
09        }
10 
11        public double Sub(double i, double j)
12        {
13            return (i - j);
14        }
15 
16        public Complex AddComplexNo(Complex i, Complex j)
17        {
18            Complex result = new Complex();
19            result.Real = i.Real + j.Real;
20            result.Imaginary = i.Imaginary + j.Imaginary;
21            return result;
22        }
23 
24        public Complex SubComplexNo(Complex i, Complex j)
25        {
26            Complex result = new Complex();
27            result.Real = i.Real - j.Real;
28            result.Imaginary = i.Imaginary - j.Imaginary;
29            return result;
30        }
31    }
32}
4.Modify the App.config file as shown
App.config
01<?xml version="1.0" encoding="utf-8" ?>
02<configuration>
03 
04  <system.web>
05    <compilation debug="true" />
06  </system.web>
07 
08  <system.serviceModel>
09    <services>
10      <service name="WcfMathServLib.MathService">
11 
12        <host>
13          <baseAddresses>
14            <add baseAddress = "http://localhost:8732/Design_Time_Addresses/WcfMathServLib/MathService/" />
15          </baseAddresses>
16        </host>
17 
18        <!-- Service Endpoints -->
19        <endpoint address ="" binding="wsHttpBinding" contract="WcfMathServLib.IMath">
20          <identity>
21            <dns value="localhost"/>
22          </identity>
23        </endpoint>
24 
25        <!-- Metadata Endpoints -->
26        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
27      </service>
28    </services>
29    <behaviors>
30 
31      <serviceBehaviors>
32        <behavior>
33           <serviceMetadata httpGetEnabled="True"/>
34          <serviceDebug includeExceptionDetailInFaults="False" />
35        </behavior>
36      </serviceBehaviors>
37    </behaviors>
38 
39  </system.serviceModel>
40 
41</configuration>

Result Using WCF Test Client

1. Run the WcfMathServLib project you will get the ‘WCF Test Client’
2. Select each method say ‘AddComplexNo’ Give the values in ‘Request’
3. Click on Invoke button
4. See the results in “Response”
Image(4)
Steps for creating ConsoleMathClient
1. Open Visual Studio 2010 and File->NewProject
2. select Visual C#->Windows in ‘Installed Templates’
3. select ‘Console Application’
4. Give Name as ConsoleMathClient
5. Click OK
image
2. Go to ‘Solution Explorer’ Right click on ConsoleMathClient -> Select ‘Add Service
Reference’ the below dialog will be displayed
1. Click on Discover button
2. Give namespace as ‘MathServiceReference’ and click OK
image
The service reference will be added now modify the program.cs as shown below.
Program.cs
01using System;
02using ConsoleMathClient.MathServiceReference;
03 
04namespace ConsoleMathClient
05{
06    class Program
07    {
08        static void Main(string[] args)
09        {
10            Console.WriteLine("Press <Enter> to run the client....");
11            Console.ReadLine();
12 
13            MathClient math = new MathClient();
14            Console.WriteLine("Add of 3 and 2 = {0}", math.Add(3, 2));
15            Console.WriteLine("Sub of 3 and 2 = {0}", math.Sub(3, 2));
16 
17            Complex no1 = new Complex();
18            no1.Real = 3;
19            no1.Imaginary = 3;
20 
21            Complex no2 = new Complex();
22            no2.Real = 2;
23            no2.Imaginary = 2;
24 
25            Complex result = new Complex();
26            result = math.AddComplexNo(no1, no2);
27            Console.WriteLine("Add of 3+3i and 2+2i = {0}+{1}i", result.Real, result.Imaginary);
28 
29            result = math.SubComplexNo(no1, no2);
30            Console.WriteLine("Sub of 3+3i and 2+2i = {0}+{1}i", result.Real, result.Imaginary);
31 
32            Console.ReadLine();
33        }
34    }
35}
Result
Compile and Run the project to see the Result
image