-
Notifications
You must be signed in to change notification settings - Fork 1
Grails basics
Two very useful resources are this introductory book on Grails and the the Grails documentation. Going through the tutorial in the book is a great way to get used to the key concepts of Grails. However, as a quick reference, some of the basic ideas are summarized here and connected to examples in Metridoc-RID. For people experienced in web frameworks, this may seem very basic, however the assumption here is a background in coding but not necessarily a background in web development.
MVC is a web architecture pattern that helps organize code by its functionality in displaying data on the web. A succinct diagram describing this pattern can be seen here: MVC model. To put this into Metridoc-RID terms, let's briefly go over what RID does. In very simple terms, RID enables users to create transactions, view them, and edit them. They do this through the web interface, which is the view. Buttons in this view, such as save and edit, correspond to methods in the controller. Changes users make are passed from the view to the model by the controller. The model contains information about the data being accessed, and also what type of view should be used. So, let's say a user makes a new transaction on the create page and afterwards the page redirects to the show page. The workflow would be
- User fills out a form on the "create" page and clicks the create button in the view
- The create method of the controller is run.
- This method updates the data in the model, which includes the new transaction and also the instruction to go to the "show" page.
- The model now contains the new data and the new view instruction.
- The user is now taken to the "show" view where the new transaction information is displayed.