The Scrivito SDK lets you turn any widget into a reusable gem. There are several advantages of a widget gem compared to a widget implementation directly in the application.
- You can more easily reuse code in different applications and organize that code so that it can be maintained easier.
- You can separate concerns regarding the development of the widget from the development of your application. Maybe you even want a different team to work on your widgets.
- You have an easier time to update a widget across multiple applications, which is very important to save valuable time when updating a third party library used in your widget code or when you have fixed a bug in your widget logic.
- It allows you to publish your widgets, use widgets maintained by other developers and rely on a usually more robust code base instead of reinventing the wheel. As the community gets bigger and the selection of widgets becomes richer, you can benefit from a wide range of widgets and ready-to-use code, accelerating the development of your application.
- You learn and practice a very important aspect of structuring your Ruby application. Developing your own gems also opens a door to the very active open source Ruby community.
The only disadvantage of turning your widgets into gems is probably the cost of learning how to do it, and a bit more complexity regarding the maintenance of your applications. So let's get started and outsource a simple text widget to a gem.