自定义 MVVM 实现 Vs.棱镜 [英] Custom MVVM implementation Vs. PRISM

查看:14
本文介绍了自定义 MVVM 实现 Vs.棱镜的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题的灵感来自这个封闭的问题:

This question is inspired from this closed question:

Prism 实际提供什么开发商?值得吗?

我已经在企业应用程序中实现了我自己的自定义 MVVM 实现.我有兴趣了解:

I have already implemented my own custom MVVM implementations in enterprise applications. I am interested in knowing:

  • 我为什么要学习 PRISM(特别是 PRISM,而不是其他 MVVM 框架)?
  • PRISM 相对于自定义 MVVM 实现的优势和
  • 投资学习 PRISM 是否值得?

我希望这个问题不是主观的,请大家不要争论:)

I hope this question is not subjective and everyone please don't get into arguments :)

推荐答案

与许多为您执行常见任务的框架一样,您可以获得:

As with many frameworks that do a common task for you, you get:

  1. 经过更多人的考验:不仅仅是你自己.这(希望)包括单元测试,您在构建自己的框架时可能会也可能不会进行这些测试.
  2. 对其他开发人员更具可读性:没有其他人对您的自定义 MVVM 框架有经验.但是,如果其他开发人员加入您的项目、加入您的团队或加入您的公司,他们可以直接跳入 Prism 代码.
  3. 更好的文档:同样,任何新加入的人都可能必须通过手动从您的大脑和团队中的任何其他用户那里收集集体知识,并通过查看源代码.第三方框架有自己的文档,互联网上还有更多的博文.
  4. 更好的社区:您可以在 StackOverflow 上提出有关我如何使用 Prism 做 X"的问题?你不能用你的自定义框架来问这个问题.
  5. 可能更有能力:由于需要为更多用户提供服务,而不仅仅是您/您的团队,因此将添加更多功能.如果您需要做一些您以前从未做过的与 MVVM 相关的事情,那么您自己的 MVVM 框架可能没有内置对它的支持.但它很可能在 Prism 中.
  6. 更好的结构:假设您想做一些与 MVVM 相关的事情,但它不在 Prism 中.很有可能,这是有充分理由的!如果某事不在为在给定领域工作而制定的(合理成熟的)框架中,则表明您正在尝试采用一种不自然或笨拙的方式来解决问题.使用你自己的框架,很容易说哦,我会添加那个功能",然后 6 个月后意识到你犯了一个巨大的错误,因为这个新功能使你的代码很难遵循或最终成为很多向量错误之类的.
  7. 简历项目:对于雇用实施并使用过自定义 MVVM 框架"的人,我会有复杂的感觉.虽然这可能意味着他们很聪明,但它也可能表明可怕的非建在这里综合症".另一方面,将Microsoft Prism MVVM 框架"放在一大堆技术中可能很好,但也不是一个惊喜.两全其美的是一个更长的要点,沿着对 MVVM 模式的深入理解,通过在切换到 MVVM Prism 之前首先实现用于学习目的的玩具 MVVM 框架来实现".是的,这三者之间的区别不会决定你的简历的成败,非内置综合症是有希望在面试中出现的,但值得记住,特别是如果你正在申请对于一个收到足够简历的地方,他们可以舍弃任何让他们稍微不安的东西.
  1. Tested by many more eyeballs: than just yourself. This (hopefully) includes unit tests, which you may or may not be doing while building your own framework.
  2. More readable for other developers: nobody else has experience with your custom MVVM framework. But if another developer joins your project, or joins your team, or joins your company, they can jump straight into Prism code.
  3. Better documentation: Along the same lines, anyone new joining likely has to learn the ropes by manually gathering the collective knowledge from your brain, and any other users on the team, and by looking at the source code. Third party frameworks have their own documentation, and tons more blog posts on the internet.
  4. Better community: You can ask questions on StackOverflow about "how do I do X with Prism?" You can't ask that with your custom framework.
  5. Likely more capable: by needing to serve more users than just you/your team, more features will have been added. If you need to do something MVVM-related that you've never done before, chances are support for it isn't built in to your own MVVM framework. But it's likely in Prism.
  6. Better structure: Let's say you wanted to do something MVVM-related but it wasn't in Prism. Very likely, there's a good reason for that! If something's not in a (reasonably-mature) framework made for working in a given domain, that's a sign that what you're trying to do is an unnatural or awkward way of approaching the problem. Working with your own framework, it's too easy to say "oh I'll add that feature," then 6 months later realize you made a huge mistake because this new feature makes your code very hard to follow or ends up being a vector for lots of bugs or whatnot.
  7. A CV line-item: I would have mixed feelings toward hiring someone who had "implemented and used custom MVVM framework." While it could mean they're smart, it could also indicate the dreaded "not built here syndrome." On the other hand, putting "Microsoft Prism MVVM Framework" among a huge list of technologies could be nice, but isn't a wow-er. The best of both worlds would be a longer bullet point, along the lines of "Deep understanding of the MVVM pattern, achieved by first implementing a toy MVVM framework for learning purposes before switching to MVVM Prism." Yes, the difference between these three isn't going to make or break your CV, and not-built-here syndrome is something that would hopefully come up in an interview, but it's just worth keeping in mind, especially if you're applying for a place that gets enough resumes they can afford to throw out anything that unnerves them slightly.

这篇关于自定义 MVVM 实现 Vs.棱镜的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆