软件架构设计日记(1)

做了快两年的软件架构设计,把一些心得写下来,与人分享。望读者多提意见:peiyu55@qq.com 。以最近个人设计的一个代码生成器为例。

 

基本需求:按语法规则及要求生成客户端代码(activescript,javascript),服务器端代码(c#,vb.net,java)。代码均为完整的接口,类,委托,等代码。并可以扩展到其他语言。

开发环境:vs2008 c#

 

接口设计:

  • Icodecteate
    {
    string classID;
    string classname;
    string classrem;
    string getcodestr();
    。。。
    }
  • Ifunctioncreatecreate
    {
    string functionname;
    string functionrem;
    string getcodestr();
    。。。
    }
  • Iargcreate
    {
    string argname;
    string argrem;
    string getcodestr();
    。。。
    }
  • 。。。

 实体类设计:

  • class ascodecteate:Icodecteate
  • class jscodecteate:Icodecteate
  • class cscodecteate:Icodecteate
  • class vbcodecteate:Icodecteate
  • class javacodecteate:Icodecteate
  • class asfuncodecteate:Ifunctioncreatecreate
  • class jsfuncodecteate:Ifunctioncreatecreate
  • class csfuncodecteate:Ifunctioncreatecreate
  • class vbfuncodecteate:Ifunctioncreatecreate
  • class javafuncodecteate:Ifunctioncreatecreate
  • class asargcodecteate:Iargcreate
  • class jsargcodecteate:Iargcreate
  • class csargcodecteate:Iargcreate
  • class vbargcodecteate:Iargcreate
  • class javaargcodecteate:Iargcreate

    。。。。。

基本架构设计完成,开始编码,编码过程中发现,对象化程度不高,决定进行架构迭代,将部分功能细化,再添加7个实体类。继续编码,完成。测试,成功。最后,进行架构优化,添加5个基类,将一部分通用方法上移至基类,减少了代码量。另外添加泛型的应用,降低耦合性,提供灵活性,和扩展能力,满足“可以扩展到其他语言”的要求。到此 共进行了三次架构迭代, 项目基本完成。

 

 

 待续。。。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值