简体   繁体   English

Flutter 应用程序的 BLoC、MVVM、MVC 之间的最佳设计模式是什么?

[英]What is the best design pattern between BLoC, MVVM, MVC for Flutter app?

I'm going to develop a management app for a company in Flutter and since I never worked with this framework i was looking for the best practices and desin patterns to use.我打算在 Flutter 为一家公司开发一个管理应用程序,因为我从未使用过这个框架,所以我一直在寻找最佳实践和设计模式来使用。

The app will be about employes management for a company.该应用程序将与公司的员工管理有关。 The main features will be:主要特点是:

  • The management of the employes profiles;员工资料的管理;
  • The possibility to upload documents directly in the app;直接在应用程序中上传文件的可能性;
  • Create online quiz for the employes in trainership;为参加培训的员工创建在线测验; I'm struggling to choose the right design pattern.我正在努力选择正确的设计模式。 Usually for the frontend i use either the MVC or MVVM, but since this is my first Flutter app i made some researches and find out that one of the best pattern for Flutter is BLoC.通常对于前端,我使用 MVC 或 MVVM,但由于这是我的第一个 Flutter 应用程序,我进行了一些研究并发现 Flutter 的最佳模式之一是 BLoC。 I already tried to implement a simple app to try this pattern and i understood the way it works, but since I'm a noob in Flutter i was looking for some advices from someon who is more expert than me.我已经尝试实现一个简单的应用程序来尝试这种模式,并且我了解它的工作方式,但由于我是 Flutter 的菜鸟,我一直在寻找比我更专家的人的一些建议。

Thank you in advance for the help.预先感谢您的帮助。

the best practices and design patterns to use it is TTD使用它的最佳实践和设计模式是 TTD
it helps you to Keeping your code clean and tested on the other hand, larger projects start falling apart when you mix the business logic everywhere.它可以帮助您保持代码清洁和测试另一方面,当您在各处混合业务逻辑时,较大的项目开始分崩离析。 Even state management patterns like BLoC are not sufficient in themselves to allow for easily extendable codebase.即使像 BLoC 这样的 state 管理模式本身也不足以允许轻松扩展代码库。 to get more information about TTD you can look to this tutorial in this link: https://resocoder.com/2019/08/27/flutter-tdd-clean-architecture-course-1-explanation-project-structure/要获得有关 TTD 的更多信息,您可以查看此链接中的本教程: https://resocoder.com/2019/08/27/flutter-tdd-clean-architecture-course-1-explanation-project-structure/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM