Learning SharePoint   Enhance Your SharePoint Knowledge

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Check Out Our New SharePoint 2013 series!

SharePoint 2010 developer interview questions

07/02/2010  
Category: Interview Questions, SharePoint 2010


Part 1 Part 2 Part 3 Part 4

Q. How does Client object model works ?
Ans. When we use SharePoint client API’s to perform a specific task, the SharePoint Foundation 2010 managed client object model bundles up these uses of the API into XML and sends it to the server that runs SharePoint Foundation. The server receives this request, and makes appropriate calls into the object model on the server, collects the responses, forms them into JavaScript Object Notation (JSON), and sends that JSON back to the SharePoint Foundation 2010 managed client object model. The client object model parses the JSON and presents the results to the application as .NET Framework objects (or ECMAScript objects for ECMAScript).

Q. How many types of Client Object model extension are available in 2010 and when would you use one or the other.

Ans. To develop rich client side solutions, three set of client-side APIs has been introduced in the Microsoft.SharePoint.Client namespace. The three APIs are targeted for three different types of clients.
1. .net Managed applications – These are used when we have to create console applications or window applications, web applications which are not running inside SharePoint Contex.
2. For Silverlight applications
3. ECMAScript – It is a client object model extension for using with JavaScript or JScript. This is used for creating applications which are hosted inside SharePoint. For example, web part deployed in SharePoint site can use this JavaScript API for accessing SharePoint from browser using JavaScript.

Q. What is difference between Load() and LoadQuery() methods ?

Ans. Load method populates the client object directly with what it gets data from the server i.e. a collection object like ListItemCollection etc. but LoadQuery returns the data as a completely new collection in  IEnumerable format. Other major difference is that the Collections that you load using the Load() method are eligible for garbage collection only when the client context variable itself goes out of scope where as, in  these collections go out of scope at the end of  IEnumerable<List> list.

Q. How can you write efficient and better performing client object applications ?

Ans. You can always use Lambda expressions in your queries to return only specific properties that will be used in your block. You can also use LoadQuery() method and specify multiple levels of properties to load for e.g. while returning specific properties of the lists using LoadQuery(), you can also specify the fields to return from each list to optimize the data access.

Q. What are the Authentication methods for your client object model application ?

Ans. Basically there are three (3) authentication options you can use when you’re working with the Client Object Model in SharePoint 2010:

* Anonymous
* Default
* FormsAuthentication

You can specify clientContext.Authentication = Anonymous\Default\FormsAuthentication, If you do not choose an authentication method in your code, the application will default to using the client’s Windows Credentials (DefaultCredentials). For more details see Authentication Setup in SharePoint 2010 Client object model

Q. How do you access ECMAScript object model API’s ?

Ans. The ECMAScript library is available in a number of JS files in the LAYOUTS folder. The main file among number of .js files is SP.js. When you include this file in the APSX page using a ScriptLink control, all other required JS files are loaded automatically. By linking SP.js to your page, the SP namespace gets registered. SP is the SharePoint namespace that contains all objects. For debugging purposes every js file also has a ‘debug’ equivalent in the same folder.

Q. What is the purpose of calling clientContext.ExecuteQuery() ?

Ans. ExecuteQuery gives you the option to minimize the number of roundtrips to the server from your client code. All the components loaded into the clientcontext are executed in one go.

Part 3 Next >>

Subscribe to Learning SharePoint Subscribe
Twitter Learning SharePointFollow Us
in Learning SharePoint
Advertisement

Random Posts

Sharepoint 2010 – Create custom modal dialog using Visual studio 2010 – II
Sharepoint 2010 – Create»

In Continuation with the Part 1 of Sharepoint 2010 – Create custom modal dialog using Visual studio 2010 8. Next»

Get List,ListItems using Ecmascript\Javascript Client Object model SharePoint 2010
Get List,ListItems using Ecmascript\Javascript»

To Retrieve Sites\Subsites and Site collections See the Get Site,Site collection using Ecmascript\Javascript Client Object model SharePoint 2010 Get List  - <script»

Customizing the Notification Area in Sharepoint 2010
Customizing the Notification Area»

Beyond working with status information, you can also customize the notifi cation area on the upper – right side of»

Recent Forum Posts

Linq to Sharepoint

by RS on May 18, 2012

comments on the code

by spbsmile on May 18, 2012

connection(add) EditControlBlock and my program

by spbsmile on May 18, 2012

Custom master pages used in multiple SharePoint 2010 sites

by ubersteve on May 18, 2012

upload file and click on button but cant upload file into list by using below code

by santhoshreddy on May 18, 2012