如何开发MS CRM类的应用程序 [英] How to develop MS CRM kind of application

查看:24
本文介绍了如何开发MS CRM类的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我曾与 MS CRM 合作过.在那里我们可以以图形方式设计我们的自定义实体,然后我们还可以构建一个可视化表单来对该实体执行 CRUD 操作.

I have worked with MS CRM. There we can design our custom entity graphically and then we can also build a visual form to perform CRUD operations on that entity.

从最终用户的角度来看,这感觉非常简单.但是,我很想知道如何开发类似的应用程序,让我可以动态设计表格并动态设计 UI.

This feels so simple from end user's perspective. However I am interested to know how can I develop the similar kind of application where I design my table on the fly and the design UI on the fly.

我想知道的是他们如何动态地实现所有这些?如果我必须在一张简单的表上创建 CRUD,我需要编写大量代码.MS 如何即时实现一切?任何指针、任何文件都会有很大帮助.

What I want to know is like how do they achieve all of this dynamically? If I have to create CRUD on one simple table, I need to write good amount of code. How MS achieves everything on the fly? Any pointers, any document would be of great help.

推荐答案

我不知道他们实际上是怎么做的,但如果是我,我会使用 属性反射.

I have no idea how they actually do it, but if it were me I'd use attributes and reflection.

这就是我认为它可能会起作用的方式/或者粗略地说你是如何做到的......

Here's how I think it'd probably work / or rougthly how you could do it...

组件

系统需要一堆组件或子系统;它们可以是您自己编写的内容或现有库(如果可以,请使用现有库):

The system would need a bunch of components or sub-systems; they coudl be stuff you write yourself or existing libraries (use existing libraries if you can):

  • 某种 CMS,除非您想将其构建到您已有的系统中.
  • 一个 UI 组件/控件,可让用户创建他们的对象".要想做得好,这需要相当先进的 UI(SilverLight?HTML5?)——尽管我猜你可以使用一些非常基础的东西.
  • 存储用户对象"的某种方式 - 这基本上是数据,您希望将其存储在某种中性"存储库中.
  • 可以实现实际 CRUD 的东西 - 我正在考虑某种 ORM 工具,例如实体框架、Lightspeed、NHibernate.您还需要一个用于 CRUD 操作本身的数据源目标.

诀窍在于第 2 点和第 3 点;这是我定义一组可用于定义用户创建的对象的属性的地方.这些属性在逻辑上将流程连接在一起.因为属性可以在运行时读取:

The trick is in points 2 and 3; this is where I'd define a set of Attributes that could be used to define the user created objects. These attributes are what logically joins the process together. Because Attributes can be read at runtime:

  • 他们将能够驱动允许用户组合对象"的 UI.
  • 准备好后,您可以生成实际实现用户定义对象的实际类 - 然后使用适当的属性修饰这些对象.
  • 不知何故,ORM 工具知道如何将这些对象的属性(基于属性)映射到数据存储区,或者自己编写 DAL - 也许您是 DAL 会包装 ORM?

我使用的另一种方法几乎基于此,但它也使用了接口,并且数据存储为 XML 的blob"——而不是特定的离散元数据.

Another approach I've used is based pretty much on this but it also makes use of interfaces, and the data is stored as a "blob" of XML - not specific discrete metadata.

这篇关于如何开发MS CRM类的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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