It is useful to check SharePoint development from three perspectives:
- Build scalable applications for. NET FrameworkProgram
- Build database applications
- Build traditional rich client applications
Compare SharePoint applications with scalable. NET web applications
You can check SharePoint development from a developer's perspective. This developer builds a highly scalable, loosely coupled web application that runs on a large server farm. These applications must process hundreds or thousands of page views per minute.
Sharepoint is based on ASP. NET and runs on IIS. It can have multiple front-end web servers that handle load balancing. SQL Server provides the integrity, scalability, reliability, and security of the data and documents stored on the SharePoint website. The following are some important ways for scaling to affect SharePoint development.
- API design. scalability will drive some features of the SharePoint programming interface. When you understand the design of programming interfaces to improve scalability, you can understand these interfaces more easily. For example, the Managed Client object model, abstracted, is very similar to the SharePoint Foundation server-side object model, but in fact it is more complex, this allows you to explicitly control data or Content Retrieval from the server.
- solution design. scalability affects the way you design a Sharepoint-based solution. You must avoid unnecessary computing or query activity design on the server. You must write an application that consumes no more resources than the expected ones. For example, this means that the core architecture of the markup language of the collaborative application and the LINQ to SharePoint are used properly to query list items.
- best practices. scalability is hidden behind some programming methods and problems that are developed as SharePoint Best Practices . For example, some objects in the SharePoint object model have associated unmanaged data. Therefore, you must understand and follow the object processing rules. Similarly, several best practices can be considered when using a large list in Sharepoint. If you do not follow these rules, it may have a negative impact on the server farm. For more information, see SharePoint Foundation best practices and Sharepoint Server best practices. For more information, see Best Practices: using disposable Windows SharePoint Services objects (this link may point to an English page) and release objects. You can use automation tools to improve your Code review. For more information, see use spdisposecheck to automatically perform a Sharepoint dispose () code review (this link may point to an English page ).
There are some issues that are the same or similar to those faced by developers who build highly scalable Web applications. I have heard of a scenario where a Sharepoint developer writes code to cyclically access all the documents in its website set at a set interval and collect information to be displayed in the tree control. This works properly in its testing environment. However, the Code Design generates a performance issue related to the actual number of documents and list items.
Scalability affects solution design in two different ways:
- You must build distributed applications that work properly when deployed on Multiple front-end web servers. For example, you can build a small create/retrieve/update/delete Web Service for Microsoft Business connectivity services (BCS) that stores data in local XML files (see business connectivity services ). However, it will not work properly when deployed on the server Load balancer server.
- You must build an application that can run normally. For example, unless you are sure that a list contains several items, do not use the object model to access it cyclically; instead, use LINQ to SharePoint and provide optimization opportunities for Sharepoint.
For more information about the similarities and differences between SharePoint development and ASP. NET development, see the slide path for ASP. NET developers. See SharePoint 2010 development by ASP. NET developers (this link may point to an English page ).
SharePoint Foundation's best practices include a guide that helps you avoid defects that negatively affect performance, including instructions on object processing, event receivers, large folders and lists, and code performance optimization.
Compare SharePoint applications with database applications
Database Application Development is one of the advantages of viewing SharePoint development. The custom list on the SharePoint site has many similarities with the database table. You can use rich metadata related to columns in the list to define these columns. In addition, the Sharepoint list can be effectively defined.Foreign keySo that you can model more interesting solutions that contain relevant data. SharePoint provides cascading and restrictive actions for delete operations. You can create these lists programmatically or declared, or write programs that use user-defined lists. These lists can be visible or hidden. You can use the security features of Sharepoint to restrict access.
One aspect of SharePoint that is directly compared with SQL databases is that you use non-program declarative query languages to retrieve data. However, instead of SQL, you will use either LINQ to SharePoint or the collaborative Application Markup Language (caml) Written in XML.
Sharepoint is deeply integrated with database technology. You can use databases, web services, and almost any data source through business connectivity services. These data sources are represented as external content types.
An interesting feature of SharePoint's data feature is that it does not have transaction guarantee. For example, you cannot ensure that either or both of the following operations occur: Insert list items in one table and update list items in another table. SharePoint will not be used as a platform for implementing transactional systems. Instead, such transactional systems should be implemented in external databases that provide adequate assurance. You can then use business connectivity services to display the data in Sharepoint. You must consider this feature when designing a Sharepoint application.
A major difference between the data function of SharePoint and the data function developed by traditional databases is that the Sharepoint list (which can be compared with the database table) is not necessarily a rectangle. In Sharepoint, the content type defines fields that constitute list items in the list (can be compared with rows. The architecture that can be viewed as a list item. The Sharepoint list can contain multiple list items of content types. Indicates a list of SharePoint items that contain two content types: labor and material.
Figure 2. Non-rectangular Sharepoint list
This will affect how you design and develop the list items and the application of fields in the list items. If you must have rectangular data, you can define a list to include only one content type. If you enable non-rectangular data, when you access the list items cyclically, you must check the content type and change the code accordingly.
Another interesting feature is that because of the internal implementation details, it is much slower to query SharePoint using LINQ to SharePoint or caml than querying a table using SQL. You do not need to create the following designs. Some of these lists unexpectedly grow to 50,000 or 100,000 items, and you can try to display the list in a browser window at will. SharePoint 2010 contains a restriction that prevents such designs from disabling the server farm. However, the user interface will become unable to respond to the user. You can process a list containing a large number of items in multiple ways. You must handle this problem intentionally. For more information, see process large folders and lists.
Sharepoint is built on SQL Server. The document library and Sharepoint list are stored in the database. When you view the architecture diagram installed in Sharepoint, you will find this. There is no special relationship between the actual SharePoint database and SharePoint developers. You never directly access this database. You always use programming interfaces to change websites, lists, and document libraries. However, you can use the same SQL Server installation to host databases that you directly use or use business connectivity services. Therefore, it can be part of the infrastructure you use to build a Sharepoint application.
Microsoft Access allows you to publish an Access database to a Sharepoint site. This provides some useful opportunities because it allows SharePoint users to share data in a consistent and familiar manner.
Compare SharePoint applications with traditional rich client applications
There are many similarities between SharePoint and the operating system:
- SharePoint contains storage. The document library that contains the hierarchical structure of the folder is similar to the files in the directory in the file system.
- SharePoint has a programmable user interface.
- When used with the operating system, you can write code that runs with different levels of privileges. By using SharePoint development, you can write code that must run with farm management creden. You can write the code that runs in the sandbox solution or Javascript that runs in the client browser.
- When used together with the operating system, you can write services that provide the necessary infrastructure for building complex and dynamic SharePoint applications.
Again, the scale is the biggest difference. Scale will drive the programmability of SharePoint. You can write high-performance software on hundreds of servers to provide a consistent experience that improves collaboration and productivity for the entire enterprise. When you switch from traditional application development to SharePoint development, it is the entrance cost you have to pay to handle the scalability problem.