|
所在平台: Udemy |
课程主页: https://www.udemy.com/course/building-modern-coldfusion-apps-with-coldbox-tamarind-v1/
课程评论:没有评论
课程名称:使用Quick ORM构建多语言应用程序(Tamarind v1) 课程概述:本课程是在几个月前发布的基础教程“构建用户登录和注册基础(Tamarind)”的基础上进行扩展的。我们将构建一个模块化应用程序,这个应用程序具有基于组件的动态菜单。菜单内容将存储在一个导航结构组件中,并作为依赖项注入到我们的处理程序中。课程结束时,用户可以通过在“我的账户”视图中切换语言偏好,轻松查看不同语言的菜单和核心应用程序。 首先,我们将增强MySQL数据库模式,新增14个表并使用cfmigrations模块创建外键约束。cfmigrations模块在基础教程中已经简要介绍,在本课程第二部分将再次提及。接下来,我们将使用Quick ORM构建实体并将其映射到数据库模式。从主页出发,我们将建立一个主要菜单,包含称为“流程”(或Tamarind中的功能)的选项,如管理员和全球化,这些选项会根据主菜单的导航动态保持在上下文中或消失。全球化功能将实现为Coldbox自定义模块。每个子菜单选项将链接到与其对应处理程序中定义的操作(索引、新建、创建、编辑、更新、删除)相映射的视图,同时在不同视图之间点击时跟踪当前菜单的导航游标。 我们还将使用Coldbox事件拦截器以及添加到Main.cfc处理程序的方法来捕捉应用程序中的无效事件,并在Coldbox配置文件中注册这些方法,以防止用户操控URL,从而触发异常。接着,我们将自定义应用程序布局,并使用可重用事件的概念构建动态菜单。通过使用Viewlets处理程序,我们将深入探索Model-View-Controller模式,特别是理解请求集合结构(RC, PRC)在数据交换中的作用。 然后,我们将构建应用程序的视图(或表单),并结合Coldbox的cbValidation和cbMessagebox模块,将其关联到各自的处理程序和实体。我们还将演示如何使用调试工具优化查询性能。虽然可以直接使用qb模块查询数据库表,但通过在内存中对实体执行查询,使用qb和Quick ORM的性能优势显而易见。在调试工具的帮助下,我们将展示如何使用称为“急切加载”的技术来提升查询性能。最后,在课程的最后部分,我们将为国际化(i18n)配置项目。 我们将加载九种语言的资源包,包括阿拉伯语(阿联酋)、英语(美国)、英语(新加坡)、法语(法国)、法语(加拿大)、日语、韩语、泰语和汉语(新加坡)。在Tamarind v1中,我们的应用程序不会生成资源包,因为没有维护字典键及其翻译的功能,这意味着资源包将保持不变。我们的菜单组件及应用程序核心将能够支持以上九种语言的翻译,具体实现方式为创建一个翻译构建服务组件,并通过应用程序助手调用getTranslation()函数,使其可用于布局、处理程序和所有视图。 课程结束时,您将对Coldbox框架及其布局、模块、实体、处理程序和国际化(i18n)有扎实的实践理解,并在每个开发阶段使用TestBox进行适当的测试。最终,我们将交付Tamarind v1版本的真实世界基础应用程序,用户界面使用基础Bootstrap构建。
This course expands on the foundation tutorial titled "Build a user login and registration foundation (Tamarind)" that was released a few months ago. We are going to build a modular application that features a component driven dynamic menu. The menu content will be stored in a navigation structure component that will be injected as a dependency in our handlers. At the end of the course, this menu and the core application will be presented in different languages by simply toggling the user locale preference in the MyAccount view where the user can edit his/her account.We are first going to enhance our MySQL database schema with additional tables (14 altogether) and create foreign key constraints with the help of the cfmigrations module. The cfmigrations module was already briefly covered in the foundation tutorial but will be re-visited again in section 2, at the beginning of this course. Next, we are going to build entities and map them to the database schema using Quick ORM. From the Home page, we'll have a main menu of what we call "processes" (or features within Tamarind) such as Admin or Globalization that link to an array of sub-menu options that would remain in context or disappear dynamically from the view, as we navigate through the main menu. One of the features (Globalization) will be implemented as a Coldbox custom module. Each sub-menu option will then link to views mapped to actions defined in their corresponding handler (index, new, create, edit, update, delete), while keeping track of the current menu navigation cursor as we click around between views. We are also going to trap invalid events in our application with a Coldbox event interceptor and with methods added to the Main.cfc handler that are registered in the Coldbox configuration file to prevent users from manipulating the URL and therefore trigger exceptions.We are then, going to customise the application layout and build a dynamic menu using the concept of re-usable events with the Viewlets handler. Working with the Viewlets component will help us explore Model-View-Controller in action, and in particular, understand the benefits of the request collection structures (RC,PRC) to exchange data between the views and the handler in conjunction with each event. Request collections constitute one of the key principles of the Coldbox MVC framework that are essential to understand.Next, we are going to build the application Views (or forms) in conjunction with Coldbox cbValidation and cbMessagebox modules, and associate them to their respective handlers and entities. Next, we are going to demonstrate how to use the debugger to tune the performance of our queries. Although you may query database tables directly with the qb module, the performance advantage of using qb and Quick ORM stems from performing queries on entities in memory, not on database tables to retrieve records. With the help of the debugger we will show you how to use a technique known as eager loading to improve query performance. Finally, in the last section, we will configure our project for internationalisation (i18n). We are going to load resource bundles for the following nine locales: Arabic(UAE), English(US), English(Singapore), French(France), French(Canada), Japanese, Korean, Thai and Chinese(Singapore). Note that in Tamarind v1, our application will not generate resource bundles as the result of the maintenance of dictionary keys and their translations in the various locales, which means that the resource bundles will remain as they are, with no feature to update them.Our menu component as well as the core of our application will then be enabled for translation in any of the nine locales above listed. We will achieve that with the creation of a Translation builder service component and by using a technique called an Application helper that will fetch a getTranslation() function from a single location in the code and make it available to our layout, our handlers and all our views.At the end of the course, you should have acquired a solid and practical understanding of the Coldbox framework using Layouts, Modules, Entities, Handlers and Internationalisation (i18n), with proper testing using TestBox at every stage of our development. As a result, we would have delivered Tamarind, in its version 1, a real world foundation application, using basic Bootstrap for its user interface.