zoukankan      html  css  js  c++  java
  • ORM 革命 —— 复兴 | ORM Revolution Revived




    ORM Revolution - Revived

    ORM 革命 —— 复兴



    Under the flourious business logics, there exists the terrifying vanity.  
    在繁华的业务逻辑之下,却是令人感到一丝毛骨悚然的虚无。


    Destination 归宿

     The ORM should not have any XML config files or Attribute in business object.
     ORM不应该拥有各种xml配置文件或者业务实体的属性标签。


     The ORM should seperate the Object Schema from Object Data.
     ORM应该分离业务实体结构元数据和业务实体数据。

     The ORM user should not concern the way ORM store the data.
     ORM的用户不应该关注ORM如何对对象进行存储的。

     

    Download 下载


     Demo Project:/Files/zc22/Noebe.ORM.Demo.rar
     Demo Database:/Files/zc22/TESTOBJ.rar


     Attention: The demo project is just for TRIAL. Please DO NOT use in commercial purpose.
     注意:        演示项目目前仅用于测试。请不要使用于商业目的。


        class Program
        {
            
    static void Main(string[] args)
            {
                NoebeConfiguration config 
    = new NoebeConfiguration();
                config.Filename 
    = @"e:\temp\TESTOBJ.MDB"//请修改
                config.DatabaseType = Pixysoft.Framework.XSchEmA.DatabaseType.Access;

                OrmManager.Initialize(config);

                Card card 
    = new Card();
                card.CardType 
    = "Noebe.ORM";

                List
    <Email> maillist = new List<Email>();
                
    for (int i = 0; i < 10; i++)
                {
                    Email mail 
    = new Email();
                    mail.Address 
    = "China" + i;
                    maillist.Add(mail);
                }

                Person p 
    = new Person();
                p.PersonName 
    = "pixysoft";
                p.Card 
    = card;
                p.EmailList 
    = maillist;


                OrmManager.Instance.Commit(p);

                Card test_card 
    = p.Card;

                Console.WriteLine(test_card.CardType);
                Console.WriteLine(p.PersonName);

                List
    <Email> test_emaillist = p.EmailList;
                
    foreach (Email test_email in test_emaillist)
                    Console.WriteLine(test_email.Address);
            }

            
    class Card : ObjBase
            {

                
    public string CardType
                {
                    
    get { return null; }
                    
    set
                    {
                    }
                }
            }

            
    class Email : ObjBase
            {

                
    public string Address
                {
                    
    get { return null; }
                    
    set { }
                }
            }

            
    class Person : ObjBase
            {
                
    public string PersonName
                {
                    
    get { return null; }
                    
    set { }
                }

                
    public Card Card
                {
                    
    get { return null; }
                    
    set { }
                }

                
    public List<Email> EmailList
                {
                    
    get { return null; }
                    
    set { }
                }
            }
        }


     If there is an ORM revolution, we hope it comes from China.
    如果有那么一场ORM革命,我希望他来自中国。

    To be continued ...
    待续 ...


    Join us! We need your help!  (NOSU, Non Open Source Union)
    加入我们,我们需要您的帮助!(NOSU, 非开源联盟)

    Email: reborn_zhang@hotmail.com

    Noebe Team
    2007 - 10 -22
  • 相关阅读:
    多种方法求解八数码问题
    GridView编辑删除操作
    【翻译自mos文章】v$undostat视图没有依照每10分钟进行更新,v$undostat仅仅有1行(one rows)
    支持向量机通俗导论(理解SVM的三层境地)
    bootstrap课程13 bootstrap的官方文档中有一些控件的使用有bug,如何解决这个问题
    bootstrap课程12 滚动监听如何实现(bootstrap方式和自定义方式)
    bootstrap课程11 模态框如何使用
    bootstrap课程10 从外部引入视频到页面用什么标签
    bootstrap课程9 bootstrap如何实现动画加载进度条的效果
    bootstrap课程8 bootstrap导航条在不同设备上的显示效果如何
  • 原文地址:https://www.cnblogs.com/zc22/p/933533.html
Copyright © 2011-2022 走看看