Chinaunix首页 | 论坛 | 博客
  • 博客访问: 191680
  • 博文数量: 11
  • 博客积分: 3010
  • 博客等级: 中校
  • 技术积分: 855
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-16 16:26
文章分类
文章存档

2011年(1)

2010年(1)

2009年(2)

2008年(7)

我的朋友
最近访客

分类: C/C++

2008-04-02 23:50:18

1.Define the interface of software (named : IGlobalService),like DB operation, contains: InsertAlarm(string sql),UpdateAlarm(),SearchAlarm().
 
2.Create class like OracleGlobalService to implement the interface of 
IGlobalService.
  The duty of OracleGlobalService is to realize the function of SQL-opeartion Or other functions.
 
3.OracleService ,then we can create another class which our OracleGlobalService can inherite from it,
  because in the OracleService,we may include function like :
    <1>.CheckConnectionStatus()
    <2>.IDBTransaction
    <3>.Commit()
    <4>.RollBack()
 
4.Then,above all,we create a class of OracleGlobalSercice which has method named CreateService,signature like:
       
 public static IGlobalService CreateService()
 {
    string gc=Configuration.AppSettings["FDCOracleService"]; 
    //this   FDCOracleService is get from App.config.
    if (gc.EmptyOrNull())
     {
       gc="FDC.Service.DB.FDCOracleService";
     }
    return (IGlobalService)Activator.CreateInstance(Type.GetType(gc));
 }
   
OracleGlobalService Implement Interface contains : IGlobalService.
OracleGlobalService Inherite from OracleService  : Mainly use the method of CheckConnectionStatus(),IDBTransaction.
 
5.App.config contains :

 
    
 

| | | | | | | | | | |
阅读(807) | 评论(0) | 转发(0) |
0

上一篇:SQL & PLUS使用技巧

下一篇:半导体术语

给主人留下些什么吧!~~