库还是自己的框架?
什么时候应该使用库或框架而不是你自己的实现。 例如。 MVVM,我应该使用 Cinch/MVVM 框架还是自己编写代码?
When should you use a library or a framework vs your own implementation.
For example. MVVM, should I use Cinch/MVVM Framework or roll my own code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
对于 MVVM 和 WPF,我个人建议在没有框架的情况下开始。
一旦你看到了“症结”点,不同的框架就会开始变得更有意义。请记住,MVVM 的各种框架旨在成为“帮助者”,以缓解处理 MVVM 时的一些痛点(例如对话/服务处理、消息传递等)。
话虽这么说,许多框架(即:Cinch)确实引导您以特定的方式工作 - 考虑到您的情况,这可能是理想的,也可能不是理想的。
我个人不使用单一框架。如果需要,我会从框架中借用想法和灵感,但发现大多数框架试图做太多事情。
话虽这么说,一旦您了解了不同的框架,只要您选择的框架适合您的开发目标,它们就会非常有用。例如,MVVM Light 提供了一个出色的、经过深思熟虑且经过测试的消息传递框架,可以极大地简化 MVVM 中的许多困难任务,所以这是获得一些非常强大的功能的好方法。
With MVVM and WPF, personally, I would recommend starting without a framework.
Once you see the "sticking" points, the different frameworks will start to make a lot more sense. Remember, the various frameworks for MVVM are meant to be "helpers" to ease some of the pain points when dealing with MVVM (such as dialog/service handling, messaging, etc).
That being said, many of the frameworks (ie: Cinch) really steer you into working a specific way - which may or may not be ideal given your circumstances.
I personally don't use a single framework. I'll borrow ideas and inspiration from a framework if required, but have found that most of the frameworks try to do too much.
That being said, once you understand the different frameworks, they are very useful, provided the one you choose fits with your development goals. For example, MVVM Light provides a fantastic, well thought out and tested messaging framework that dramatically simplifies many difficult tasks in MVVM, so it's a great way to get some functionality in place which is quite robust.
使用框架。在大多数情况下,为有截止日期的项目编写自己的框架并不是一个好主意。
对于一个业余爱好项目,是的,为什么不制作一个框架呢?
对于您的情况,您可以查看此处:
https://stackoverflow.com/questions/1280462/您正在使用什么 mvvm 框架
Use a framework. Writing your own framework on for a project, that has a deadline is not a very good idea in most cases.
For a hobby project, yeah why not make a framework.
In your case you can look here:
https://stackoverflow.com/questions/1280462/what-mvvm-framework-are-you-using
如果您被允许在项目中使用框架并且程序集大小确实不是那么重要,那么我几乎总是建议使用该框架(不包括学术项目)。
您将得到(通常)经过彻底测试和记录的东西,而不是对您自己的手卷版本进行试验和故障排除。
If you're allowed to use a Framework for the project and assembly size really isn't that important, I'd almost always recommend going with the framework (academic projects not included).
You'll get something that has been (usually) thoroughly tested and documented rather than experimenting and troubleshooting your own hand rolled version.