Presentation is loading. Please wait.

Presentation is loading. Please wait.

Sitefinity 4.0 Fluent API.

Similar presentations


Presentation on theme: "Sitefinity 4.0 Fluent API."— Presentation transcript:

1 Sitefinity 4.0 Fluent API

2 Outline Introductory example Few words about Fluent API
Fluent API vs. Native API Fluent API settings Named transactions and “using() { }” syntax Child facades Three random examples Future developments

3 Introductory example Create a news item

4 Few words about Fluent API
“Fluent interface” – coined by Eric Evans and Martin Fowler Aims to provide for more readable code Method chaining and state Methods always return the instance that defines them (context) Context can be changed by returning different façade or terminated by returning void Resources:

5 Fluent API vs. Native API
Fluent API will NOT replace Native API – it’s an alternative In Sitefinity 4.0 Fluent API aims to cover 80% of most featured functionality For very complex operations, Native API (managers) ought to be used Fluent API is implemented as a façade over one or more managers

6 Fluent API settings Fluent API provides a way to set provider
names and transaction name.

7 Named transactions and “using() { }” syntax
Named transactions allow you to commit work made in multiple provides (e.g. generic content, events, pages) in a single call using() { } syntax provides a way to write code for different types and commit in a single call upon the exit of the using block

8 Child facades Child facades examples:
Blog façade > Blog post façade Blog post façade > Comment facade Page façade > Control façade Done() method for exisiting the child facade

9 Three random examples Create a page Add dynamic field to NewsItem
Create a completely new persistent type (e.g. like in forms module)

10 Future developments Cover all the managers with Fluent API facades
Support for dynamic facades App.WorkWith<MyBlogFacade>() Code injection through Unity


Download ppt "Sitefinity 4.0 Fluent API."

Similar presentations


Ads by Google