惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

博客园 - tf.li

清理MVC4 Internaet 项目模板清理 SQL2014 尝试读取或写入受保护的内存。这通常指示其他内存已损坏 nodejs 环境配置技巧 mongdb window 服务安装批处理 bower 安装后 jade 引用404问题 我的Prototype模式框架 转自CnBeta 令人深思 [译稿]为什么我们不要 .NET 程序员 JSON.NET、WebService与JQuery协同工作 我修改的IP地址掩码 呵呵~~开心 Ext.Ajax.request 传值问题 [求助]关于文本行转列的疑问~~ To Terrylee 我的设计模型之小议工厂模式 我的设计模型之装饰者模式 我对线程池的一点理解 面向接口编程之惑 第二版 面向接口编程之惑 我的设计模型之适配器模式 我的设计模型之简单工厂
从小做大之一---------一切从建模开始
tf.li · 2008-09-21 · via 博客园 - tf.li

刚刚从项目上面回来 没多久 感觉自己 好像最近比较颓废 总是玩Dota(不过这个还确实蛮好玩的),所以周日 下雨天 赶快补补课 把自己的心得体会 稍微的追变成代码了啊 这个 其实是我们正在做的例子,需求是客户的,但是代码是我

Model层

 1    public class Bill:InterFace.BillPass,InterFace.BillBack
 2    {
 3        public People Maker;
 4        public string Department;
 5        public Hashtable Right;
 6        public static Bill bill = new Bill();
 7        private Bill()
 8        {
 9            GetBillPeople();
10        }

11        public static Bill GetBill()
12        {
13            if (bill == null)
14            {
15                bill = new Bill();
16                return bill;
17            }

18            else
19            {
20                return bill;
21            }

22        }

23        public void GetBillPeople()
24        {
25            this.Maker = People.GetPeople("123""456");
26        }

27        BillBack 成员
34
35        BillPass 成员
43    }

这个是订单类,下面一个是人员类

 1  public class People
 2    {
 3        public string name;
 4        public int age;
 5        private string ID;
 6        private string password;
 7        public static People GetPeople(string ID,string password)
 8        {
 9            People Edison = new People();
10            Edison.age = 24;
11            Edison.ID = "12138";
12            Edison.name = "Edison";
13            Edison.password = "456";
14            return Edison;
15
16        }

17
18    }

这个现在是我这套系统中的两个模型,然后下面是两个接口 至于接口是做什么用的,我现在只能说是隔离行为的,我只理解到这里了啊,如果有高手愿意赐教的话可以留言。

接口层

当然这个是存在引用关系的我在这里就不废话了,大家应该都清楚吧.

然后调用的代码就是

客户端调用

本文是小弟在参加了 一个很大的项目开发之后,根据自己对设计模型的理解 以及客户需求的分析而作出的Demo,代码可能比较粗糙,但是为了体现一种思想。还望各位园友们不吝赐教,多提一些意见 我会陆陆续续的把一些其他的代码放出来 为的可能就是更好的理解抽象 更好的理解设计模式