使用什么模式为 delphi win 32 应用程序构建层

发布于 2024-07-22 05:45:18 字数 850 浏览 3 评论 0 原文

我想使用 dbexpress 开发 mysql 数据库应用程序,从头开始开发或使用现有数据库。 要创建可重用层,我应该使用哪些模式组件。 我希望该应用程序能够轻松扩展到 n 层。 尝试在谷歌上搜索现成的框架,但我发现没有太多信息(有些缺乏文档,有些缺乏示例)。

著名的 java 框架 i.batis 或 hibernate 的一些东西会很有用。 我熟悉在 PHP 中使用这样的框架来开发 xml 定义的业务对象。 我尝试将其转换为 Delphi,但这是一项艰巨的工作。(Delphi 严格类型的抽象使我的经验水平变得困难。)

Ruby on Rails ActiveRecord 类实现也可能很有用。

我永远不清楚是否要丢弃 dbaware 组件。

我尝试实现一些设计模式来分离层(数据访问/连接)、(业务对象)、(gui),但没有成功。 我试图实现的是模仿乐高(我可以使用任何数据库引擎,任何delphi数据库技术(bde,ado等。dbexpress是必须的,其他是可选的)。我也可以使用xml(mybase或native),文本文件(类似 csv、遗留解析代码)

我可能需要单层、客户端/服务器和 n 层。

此外,我可能需要某种 Web 服务实现(客户端可能是除 delphi 可执行文件之外的任何技术,所以我认为 xml、wsdl 是必要的)

数据访问层是最重要的部分,因为其他框架将在其上开发(用户身份验证、应用程序配置等...)。

  • 轻松生成 框架(我不知道要遵循什么:数据库适配器模式、数据库连接工厂、映射器、数据访问对象等。)
  • 我可以使用现有的框架(即时对象不适用。不适用于现有的数据库模式)。我尝试过的其他人缺乏 dbexpress 支持或者我无法理解配置。

I want to develop mysql database application using dbexpress to develop from scratch or work with existing databases. To create reusable layers what patterns-components should I use. I want the app to be scalable to n-tier easily. Tried google search for ready frameworks but I found nothing much informative (some lack documentation, some lack examples).

Something in the veins of famous java frameworks i.batis or hibernate would be useful. I'm familiar using such a framework in PHP to develop xml defined business objects. I tried to convert it to Delphi but it is much of a work.(Abstraction with delphi strict typing makes everything hard for my exprerience level.)

Also ruby on rails activerecord-like implementation may be useful.

I could never be clear about trashing dbaware components or not.

I tried to implement some design patterns to separate layers (data access/connection), (business objects), (gui), but with no success. What I try to achieve is to mimic lego (I can use any database engine , any delphi database technology(bde, ado etc.. dbexpress is a must, others are optional). Also I may use xml (mybase or native), text files (csv-like, legacy parsing code)

I may need single tier, client/server and n-tier.

Also I may need some kind of web service implementation (the client side may be any technology apart from delphi executable , so I think generating xml, wsdl easily is necessary)

The data access layer is the most important part. It must be flexible because other frameworks will be developed upon it (user authentication, app configuration etc...).

  • I may challenge to develop my own simple framework (I don't know what to follow: database adapter pattern, db connection factory, mappers, data access objects etc..)
  • I can use an existing one (instantobjects not applicable. not work with existing db schema). Some of the others I tried lack dbexpress support or I could not understand the configuration.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

那小子欠揍 2024-07-29 05:45:18

穆罕默德的回答涵盖了您问题的 n 层部分。 与 i.batis 或 hibernate 相似的部分将您推向面向对象的持久性框架,例如 tiOPF,它们在某种程度上是一种不同的野兽。

以下是我目前所知道的 Delphi 持久性框架的列表。 我相信 CG 还在 Delphi Live 上做了某种持久性演示,所以可能还会有其他东西。

FWIW - 我在几个商业产品中使用了 InstantObjects (IO)(尽管以非标准方式),并且正在开发到 Delphi 2009 的端口.PressObjects 是由一位 IO 开发人员开发的,我最近加入了该项目,因为它看起来很有趣。 自 YMMV 以来,我不会打折像 tiOPF、Jazz 等框架。 我通过评论会对这些框架造成伤害,因为除了简单的测试用例之外我没有使用它们。

Mohammed's response covers the n-Tier part of your question. The part about being similar to i.batis or hibernate pushes you towards object-oriented persistence frameworks like tiOPF which are a somewhat of a different beast.

Here is the list of persistence frameworks for Delphi that I am aware of at this time. I believe CG also did some sort of persistence demo at Delphi Live so there might be something else on the horizon.

FWIW - I have used InstantObjects (IO) in several commercial products (albeit in a non-standard way) and am working on a port to Delphi 2009. PressObjects is by one of the IO developers and I recently joined that project since it looks interesting. I would not discount frameworks like tiOPF, Jazz etc since YMMV. I would be doing these frameworks a disservice by commenting since I have not used them beyond simple test cases.

ゝ杯具 2024-07-29 05:45:18

如果您想构建可以从不同客户端(非 Delphi)访问的 Delphi n-Tiers 解决方案,您有以下选项:

  1. RemObjects 的 DataAbstrct。
  2. kbmMW
  3. MIDAS /DataSnap 内置于 Delphi

If you would like to build Delphi n-Tiers solutions, that be access from diffrent clients (Non Delphi), you have these options:

  1. RemObjects' DataAbstrct.
  2. kbmMW
  3. MIDAS/DataSnap built in Delphi
醉梦枕江山 2024-07-29 05:45:18

在我的公司,我们使用 tiOPF 框架来实现这一目标。 它使用多种模式将 GUI 与对象模型分开。 它包括一个数据库层,可以连接到几乎任何数据库或文本文件。

要将非数据感知控件链接到模型,可以使用多个中介器。 有了更多经验,您就可以编写自己的中介程序。 例如,我们编写了几个中介器来链接到 DevExpress 控件。

框架背后的概念文档很好。 对于所有其他问题,有一个所有核心开发人员经常访问的新闻组。

看看 tiOPF 网站!

At my company we use the tiOPF framework to achieve this. It uses several patterns to separate the GUI from the object model. It includes a database layer to connect to almost any database or text file.

To link the non-data-aware controls to the model there are several mediators available. With some more experience you canwrite your own mediators. We have written several mediators to link to the DevExpress controls, for instance.

The documentation of concepts behind the framework is good. For all other questions there is a newsgroup that is frequently visited by all core developers.

Have a look at the tiOPF website!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文