Search code examples
restier

OData Restier - what for this suitable ? Is it worth to use it in production?


I need the opinion of the person who has used/uses 'Restier' in the production.

I see some issues - security is disabled by default - all data can be read by the user who is not even authorized on site. Even if we plan to restrict some data - you can not remove one column from the table - only all columns will be visible to the client.

And the last - all business-logic moved to browser javascript - which is not good. If we need to perform a complex operation (which must be in a single transaction) - it is not possible.

My opinion - 'Restier' is designed for very simple RESTful projects - such as the address book, todo list etc. If you develop the big commercial application - that operate complex data scheme and operate money transactions - you should avoid using 'Restier' in a project.

Any thoughts appreciated.


Solution

  • REST is an arquitectural style for Web Services. OData is a standard that describes a good technology independent implementation of REST. RESTier is a library that implements OData V4.

    The complexity of your domain must be in your Domain and Application Layer. You can use RESTier to expose your domain functionality as a WebService the way you like. You could expose your entities only for Read operations and expose your use cases (Application Layer) as OData Actions and Functions which can the be consumed by any kind of client (iOS, Android, Web Client such as Asp.Net Mvc, Wpf , any JavaScript Frontend etc.) If you have a complex domain I would suggest you to investigate Domain Driven Design.

    Now to your questions...

    Regarding security you can implement all the goodness of Asp.Net in Restier.

    Regarding data shaping you never expose your domain entities directly through the Web Service. I would suggest to implement factories that convert back and forth between for example Customer (domain entity which represents the business logic) and CustomerDto (simple Data Transfer Object) . With this you can shape your data to be exposed the way you require.

    Having the business logic in the Front End (UI Layer), as you mentioned, is considered an anti pattern (smart UI anti pattern) if you have big domain complexity. (For simple CRUD apps is ok). Restier does not push you in this direction. It is a matter of how you architect your solution.

    Hope this helps you.