登录
首页 » Java » 设计模式

设计模式

于 2020-12-15 发布 文件大小:191KB
0 227
下载积分: 1 下载次数: 4

代码说明:

  3-5 观察者模式实例之股票变化:某在线股票软件需要提供如下功能:当股票购买者所购买的某支股票价格变化幅度达到5%时,系统将自动发送通知(包括新价格)给购买股票的股民。现使用观察者模式设计该系统,绘制类图并编程模拟实现。 3-6状态模式实例之银行转账:在某银行系统中,我们定义了账户的三种状态:(1)如果账户(Account)中余额(balance)大于等于0,此时账户的状态为绿色(GreenState),即正常状态,表示既可以向该账户存款(deposit)也可以向从该账户取款(whithdraw)。(2)如果该账户中余额小于0,并且大于等于-1000,则该账户的状态为黄色(YellowState),即欠费状态,此时既可以向该账户存款也可以从该账户取款。(3)如果该账户余额小于-1000,那么该账户的状态为红色(RedState),即透支状态,此时用户只能向该账户存款,不能在从中取款。现在用状态模拟来实现状态的转化问题,用户只要执行简单的存款和取款操作,系统根据数量自动转换到相应的状态。(Need to transport toBaiDu)

文件列表:

设计模式
设计模式\3-4实验结果.JPG, 61695, 2017-12-03
设计模式\3-4观察者模式.JPG, 89547, 2017-12-03
设计模式\3-5实验结果.JPG, 62982, 2017-12-03
设计模式\3-5状态模式.JPG, 135718, 2017-12-03
设计模式\设计模式.docx, 17436, 2017-12-11

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • REF102电压基准滤波器的应用放想。如果可以的话下在看一下
    REF102电压基准滤波器的应用放想。如果可以的话下在看一下-REF102 voltage reference filter to the radioimmunoassay. If so let"s see where
    2023-05-06 13:25:02下载
    积分:1
  • 1292(STM32精英板)
    说明:  1292心电采集模块 可实现心率监测、心电图功能(heart rate 1292 ECG acquisition module can realize heart rate monitoring and ECG function)
    2020-10-11 17:29:03下载
    积分:1
  • dds_test
    直接数字式频率合成器DDS设计、Verilog。 产生的信号可以是正弦波或方波、三角波、锯齿波等,自选。 采用DDS技术,将所需生成的波形写入ROM中,按照相位累加原理合成任意波形。 此方案得到的波形稳定,精度高,产生波形频率范围大,容易产生高频。 本实验在设计的模块中,包含以下功能: (1)通过 freq 信号输入需要的频率的值; (2)通过 wave_sel 信号选择所需的波形; (3)通过 amp_adj 信号选择波形放大的倍数。(DDS design of direct digital frequency synthesizer, Verilog. The generated signal can be sinusoidal or square wave, triangular wave, sawtooth wave and so on, optional. By using DDS technology, the required waveforms are written into ROM, and arbitrary waveforms are synthesized according to the principle of phase accumulation. The waveform obtained by this scheme is stable, accurate and easy to generate high frequency waveform. This experiment includes the following functions in the designed module: (1) Input the required frequency value through freq signal; (2) Choosing the required waveform by wave_sel signal; (3) Select the multiplier of waveform amplification by amp_adj signal.)
    2019-01-19 16:07:50下载
    积分:1
  • IEEE30节点
    用MATLAB实现基于牛顿拉尔逊法的30节点的电力系统潮流计算(Realization of power flow calculation of 30 node power system based on Newton Raphson method with MATLAB)
    2021-03-24 09:49:14下载
    积分:1
  • threemethods
    三种DOA方法:经典的MUSIC,前后向空间平滑和改进的空间平滑算法(DOA three methods: the classic MUSIC, before and after spatial smoothing and improved spatial smoothing algorithm)
    2009-05-26 14:42:01下载
    积分:1
  • 广义表的实现用vc
    广义表的实现用vc-generalized table with the realization vc
    2022-03-15 05:49:18下载
    积分:1
  • Spiking-Cellular-Automata-master
    说明:  基于元胞自动机进行的室内人员疏散模拟代码(Indoor Evacuation Simulation Code Based on Cellular Automata)
    2021-04-09 21:08:59下载
    积分:1
  • Based on freescale microcontroller designed for door control source for referenc...
    基于freescale 微控制器车门控制源码设计 可供参考-Based on freescale microcontroller designed for door control source for reference
    2022-03-15 09:15:38下载
    积分:1
  • DAQ_Technical
    NI数据采集技术文摘,采集数据的格式及硬件支持,PCIB(Abstracts NI data acquisition technology, data collection format and hardware support, PCIB)
    2010-10-11 14:08:47下载
    积分:1
  • 遗传
    说明:  使用遗传算法优化PID控制器参数,达到简单高效的目的(Genetic Algorithms for Optimizing PID)
    2019-04-18 10:43:49下载
    积分:1
  • 696518资源总数
  • 105554会员总数
  • 2今日下载