AS3-SPOD实例或教程?或任何其他的AS3的ORM [英] AS3-Spod Example or tutorial? or any other AS3 ORM

查看:138
本文介绍了AS3-SPOD实例或教程?或任何其他的AS3的ORM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

没有任何人有AS3-SPOD的经验吗? 我下载的源$ C ​​$ c从github上和AS3-信号,并开始尝试一下,但我马上拿年龄来了解通过试错的框架,并很可能会错过了很多最佳实践。该框架看起来不错,但缺乏对例子。 git的页面简化版,有很多的信息上...

Does anybody have any experience with as3-spod? I downloaded the source code from github and as3-signals and started to try it out, but I´ll take ages to get to know the framework by trial and error and probably miss a lot of best practices. The framework looks good but lack's on examples. The git page does't have a lot of info on that...

如果有人知道一些其他的ORM空气,我可以有文件的任意位纯AS3项目中使用,I'm超过感谢!

If anybody knows some other ORM for AIR that I can use on pure AS3 projects that have any bit of documentation, I´m more than thankful!

推荐答案

我希望做一个的问题,意见要求澄清,但我没有足够的声誉呢!所以,我会回答尽我的可能。

I was hoping to do a question-comment asking for clarification, but I don't have enough reputation yet! So I will answer as best I may.

我使用AS3-SPOD我的应用程序。它已经pretty的可靠且多给我我想要的。这不是真正的理想,虽然。我真正喜欢的是什么更多的ActiveRecord状,或原创的东西,可以让你通过连接条件流体语法生成查询。

I am using as3-spod for my application. It's been pretty reliable and mostly given me what I want. It's not really ideal, though. What I'd really like is something more ActiveRecord-like, or something original that lets you generate queries by concatenating conditions in a fluid syntax.

但是,如果你不使用Flex(因为我没有,你不是),那么你的选择是pretty的薄,因为大多数其他AS3奥姆斯在那里依靠的Flex的某些部分框架。除了AS3-SPOD,唯一的可能性我能找到的<一个href="http://coenraets.org/blog/2008/12/using-the-sqlite-database-access-api-in-air-part-3-annotation-based-orm-framework/"相对=nofollow>克里斯托夫Coenraets概念证明型的但他指出,这将需要大量的工作,把它发展成为一个完全成熟的ORM:

But if you're not using Flex (as I'm not, and you're not) then your options are pretty thin, as most of the other AS3 ORMs out there rely on some part of the Flex framework. Apart from as3-spod, the only possibility I could find was Christophe Coenraets' proof-of-concept but as he points out, it would need a lot of work to develop it into a fully-fledged ORM:

这仍然是概念的一个简单证明,是绝不是一个投入生产的ORM解决方案。

This is still a simplistic proof of concept and is by no means a production ready ORM solution.

和我已经没有时间了。

您说的没错,AS3-SPOD被记录非常糟糕。我想你想看看主类是SpodTable。这是从一个你做的插入,选择等对单个对象的更新可以从对象本身来完成。寻找出对SpodTable(选择,全选等)的各种信号。为了得到它去,只是标注了元数据模型类,然后从SpodDatabase实例调用CREATETABLE(MyModelClass)。

You are right that as3-spod is quite poorly documented. I guess the main class you want to look at is SpodTable. It's from that one you do inserts, selects, etc. An update on a single object can be done from the object itself. Look out for the various signals on SpodTable (select, selectAll, etc). To get going with it, just mark up a model class with metadata, then from your SpodDatabase instance call createTable(MyModelClass).

我与AS3-SPOD主要抱怨是这些(我列出他们,你不找不存在的功能,这是我浪费的时间做一个公平一点!):

My main gripes with as3-spod are these (I'm listing them so you don't look for features that don't exist, which I wasted a fair bit of time doing!):

  • 它的工作原理是异步的。如果你的实际的SQLConnection已经开通同步或异步无所谓;你要听的信号。这意味着你无法检索记录,然后使用他们马上在同样的方法,你要听的信号。我倾向于做的是做大量选择应用程序启动时,然后筛选内存中的数据,而不是做复杂的查询。 pretty的讨厌。

  • It works asynchronously. Doesn't matter if your actual SQLConnection has been opened synchronously or asynchronously; you have to listen to signals. That means you can't retrieve records and then use them straight away in the same method, you have to listen to signals. What I tend to do is to do large selects when the app starts, then filter the data in memory rather than doing complex queries. Pretty annoying.

小心为数字列空值。我看不到设置为NULL,或使用AS3-SPOD列NOT NULL的一种方式;它似乎总是使他们NOT NULL,如果你试图插入从对象空字段的行,这将导致错误。

Be careful with null values for numeric columns. I can't see a way of setting NULL or NOT NULL for columns using as3-spod; it always seems to make them NOT NULL, which will cause errors if you try to insert a row from an object with null fields.

有没有移民制度(一拉Rails的)。我的工作在我自己的滚动因为这是我的目的(这是一个移动应用程序我开发)的基本特征。

There's no migration system (a la Rails). I am working on rolling my own as that's an essential feature for my purposes (it's a mobile app I'm developing).

祝你好运!让我知道在评论中,如果有任何其他特定你希望我来支付,我可以扩大这个答案。

Good luck! Let me know in comments if there's anything else specific you'd like me to cover and I can expand this answer.

修改 我刚刚注意到 AS3SQLite 的存在。有没有使用它,但是,貌似还有其他的可能性在那里:)

EDIT I've just noticed the existence of AS3SQLite. Haven't used it yet but, looks like there are other possibilities out there :)

这篇关于AS3-SPOD实例或教程?或任何其他的AS3的ORM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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