zoukankan      html  css  js  c++  java
  • 简单程序中用vs画uml

    原来看过项目到底画不画uml的争论,我觉得真正聪明的人可以不画uml,他们可以通过代码在大脑中展现出图像。

    一般人还是画吧,不论项目大小,uml都能让自己让别人的思路清晰。
    我是一般人,写一个简单的程序,画一个简单的uml图。

    层关系图

    类图

    活动图

    这是一个简单的模拟mvc的程序

    代码:

        public class mvc_m
    {
    public List<int> i { get; set; }

    public mvc_m()
    {
    i = new List<int>();
    i.Add(1);
    i.Add(2);
    i.Add(3);
    }
    }

    public class mvc_c
    {
    public static int get_max(List<int> i)
    {
    int temp = i[0];
    foreach (var item in i)
    {
    if (item > temp)
    {
    temp = item;
    }
    }
    return temp;
    }

    public static int get_min(List<int> i)
    {
    int temp = i[0];
    foreach (var item in i)
    {
    if (item < temp)
    {
    temp = item;
    }
    }
    return temp;
    }
    }

    public class mvc_v
    {
    public static void show()
    {
    mvc_m m1 = new mvc_m();
    Console.WriteLine(mvc_c.get_max(m1.i));
    Console.WriteLine(mvc_c.get_min(m1.i));
    // m1.i=new ;
    }
    }

    public class work48
    {
    public static void Main()
    {
    mvc_v.show();
    Console.Read();
    }
    }

    学而时习之不亦乐乎,我有时没事会画画这种图.

  • 相关阅读:
    TCP协议详解-IPv4
    welcome to my cnblog
    怎样解决闭包造成的内存泄漏
    跳转路由后请求失败
    vant grid组件图片加载问题
    3次握手
    res.send()传参----Invalid status code: 1
    堆栈总结
    jQuery实现全选
    phpstudy_pro打开MySQL服务,一闪一闪的
  • 原文地址:https://www.cnblogs.com/frog2008/p/2361317.html
Copyright © 2011-2022 走看看