The steps of designing class diagram

1. Find all objects and the corrensponding function of each object.
2. Extract the classes from the above objects.
2.1 List multiple objects of a same class,and find out their common characteristics and behaviors.
2.1.1 Canvas
2.1.2 Geometry
2.1.3 Style
Painter
3. not yet
4. Situation test
situation 1: Draw a line

1. Find all objects and the corrensponding function of each object.

  1. Canvas
  2. Geometry
  3. Style
  4. Painter

2. Extract the classes from the above objects.

2.1 List multiple objects of a same class,and find out their common characteristics and behaviors.

2.1.1 Canvas

  1. Multiple objects of Canvas:
  • screen (include pdf) – using graphics card.
  • wall
  • paper

    we just need to care ‘screen’.

  1. common characteristics and behaviors
  • width
  • height
  • backgroundColor

2.1.2 Geometry

  1. Multiple objects of Geometry
  • triangle
  • rectangle
  • circle
  • point
  1. Common characteristics and behaviors
  • perimeter
  • area

2.1.3 Style

  1. Multiple objects of Style
  • lineStyle – Pen
  • regionStyle – Brush
  1. Common characteristics and behaviors
  • color
  • width

Painter

  1. Multiple objects of Style
  • projector
  • printer
  • painter
  1. Common characteristics and behaviors
  • DrawPolygon
  • DrawLine
  • DrawPoint
  • FillPolygon

You can view the results of this phase now.

3. not yet

4. Situation test

situation 1: Draw a line

  1. new Canvas(width,height,bgcolor);
  2. new LineStyle(lineType,width);
  3. List points = new List(new Point(),new Point());
  4. Geometry geo = new Polygon(points);
  5. Painter.Draw(canvas,style,geo);

From WizNote

时间: 2024-08-02 11:03:00

The steps of designing class diagram的相关文章

Dependencies and prerequisites 依赖和先决条件

This class is not specific to any particular version of the Android platform. It is also primarily design-focused and does not require knowledge of the Android SDK. That said, you should have experience using an Android device for a better understand

ReactiveCocoa Tutorial – The Definitive Introduction: Part 1/2

As an iOS developer, nearly every line of code you write is in reaction to some event; a button tap, a received network message, a property change (via Key Value Observing) or a change in user’s location via CoreLocation are all good examples. Howeve

使用自己的CSS框架(转)

[经典推介]CSS框架选择向导 不少CSS框架已经存在了一段时间,但大多数Web开发人员避免使用它们. 相反最有经验的开发者希望创建自己的CSS框架,提供个性化解决方案的优势,并减少对第三方的解决方案消极方面的依赖.虽然CSS框架,目的是加快网络开发,但是开发自己的全面的CSS框架,可能需要大量时间和精力. 本文将提供指导和精心挑选的资源,以协助你完成这一心愿.                  开始之前         首先尝试一些流行的CSS框架或者至少去看看他们提供的文件: Bluepri

程序猿的相关

Javascript jQuery Fundamentals - jQuery 新手教程. JavaScript库 代码解构 - 将JavaScript流行框架源码条分缕析展现出来 深入理解Javascript系列 <Script>的defer和async的差别 Javascript面向对象基础 Backbone.js基础 JavaScript Madness: Keyboard Events Let's Make Frameworks 国内公司JS框架:Kissy - Taobao | Ar

软件的设计理念

Key Design Concepts 关键的设计概念 Managing complexity is the most important technical topic in software development. 管理的复杂性是软件开发中最重要的技术课题. The goal of all software-design techniques is to break acomplicated problem into simple pieces. The more independent

Designing for iOS: Graphics &amp; Performance

http://robots.thoughtbot.com/designing-for-ios-graphics-performance  [原文] In the previous article, we explored different techniques to customize the look and feel of UIButton, assigning to each a difficulty level based on the complexity of the Object

Designing CSS Layouts With Flexbox Is As Easy As Pie

This article is an updated excerpt of the chapter "Restyle, Recode, Reimagine With CSS3″ from our Smashing Book #3, written by Lea Verou and David Storey. - Ed. Flexible box layout (or flexbox) is a new box model optimized for UI layout. As one of th

Wedora Platform Offline Installation Steps

1 Preparation Before the installation, you need to check the following: Install the CentOS-6.5 64 bit in your server machine.(We suggests use CentOS-6.5-x86_64bin-DVD1.iso ). The CentOS system shall be without Java and Mysql database, etc, which will

Problem to create &quot;New Database Diagram&quot; in Microsoft SQL Server Management Studio for SQL Server 2012

Error: when click "New Database Diagram", a error popped up and said "Attempted to read or write protected memory. This is often an indication that other memory is corrupt. (Microsoft.VisualStudio.OLE.Interop)" Related Link: https://so