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

转载于:https://www.cnblogs.com/zc22/archive/2007/10/22/933533.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值