Giter Site home page Giter Site logo

object-oriented-modeling---graphic-editor's Introduction

Object Oriented Modeling - Graphic Editor

Step-wise procedure to translate a problem statement into class diagram

Problem Statement

"Develop a graphic editor that can draw different geometric shapes such as line, circle and triangle. User can select, move or rotate a shape. To do so, editor provides user with a menu listing different commands. Individual shapes can be grouped together and can behave as a single shape."


Step 1). Identify Classes

Extract nouns in the problem statement.

Develop a graphic editor that can draw different geometric shapes such as line, circle and triangle. User can select, move or rotate a shape. To do so, editor provides user with a menu listing different commands. Individual shapes can be grouped together and can behave as a single shape.

Eliminate irrelevant classes.

  • Editor - Very broad scope
  • User – Out of system boundary
  • commands – Broad scope

Add more classes by analyzing requirements

  • Group - required to behave as a shape
    • Individual shapes can be grouped together and can behave as a single shape
  • View – editor must have a display area

Following classes have been identified:

  • Shape
  • Line
  • Circle
  • Triangle
  • Menu
  • Group
  • View

Basic Object Model - Graphic Editor

initial


Step 2). Identify Associations

Extract verbs connecting objects.

"Individual shapes can be grouped together"

  • Group consists of lines, circles, triangles
  • Group can also consists of other groups

(Composition)

Verify access paths.

View contains shapes

  • View contains lines
  • View contains circles
  • View contains triangles
  • View contains groups

(Aggregation)

Menu sends message to View

(Simple One-Way Association)

Basic Object Model - Graphic Editor

45861910-dbcf9980-bda1-11e8-9004-d37512a6f1fe


Step 3). Identify Attributes

Extract properties of the object from the domain knowledge.

  • Shape
    • Color
    • Vertices
  • Line
    • Color
    • Vertices
    • Length
  • Circle
    • Color
    • Vertices
    • Radius
  • Triangle
    • Color
    • Vertices
    • Angle
  • Menu
    • Name
    • isOpen
  • Group
    • noOfObjects
  • View
    • noOfObjects
    • selected

Basic Object Model - Graphic Editor

initial


Step 4). Identify Operations

Extract verbs connected with an object.

Develop a graphic editor that can draw different geometric shapes such as line, circle and triangle. User can select, move or rotate a shape. To do so, editor provides user with a menu listing different commands. Individual shapes can be grouped together and can behave as a single shape.

Eliminate irrelevant operations.

  • Develop - out of system boundary
  • Provides - have broad semantics
  • Behave – broad semantics

Following are selected operations:

  • Shape
    • Draw
    • Select
    • Move
    • Rotate
  • Line
    • Draw
    • Select
    • Move
    • Rotate
  • Circle
    • Draw
    • Select
    • Move
    • Rotate
  • Triangle
    • Draw
    • Select
    • Move
    • Rotate
  • Menu
    • Open
    • Select
    • Move
    • Rotate
  • Group
    • Draw
    • Select
    • Move
    • Rotate

Extract operations using domain knowledge

  • View
    • Add
    • Remove
    • Group
    • Show

Basic Object Model - Graphic Editor

initial


Step 5). Identify Inheritance

Search “is a kind of” by looking at keywords like “such as”, “for example”, etc

"…shapes such as line, circle and triangle…"

  • Line, Circle and Triangle inherits from Shape

By analyzing requiremens

"Individual shapes can be grouped together and can behave as a single shape"

  • Group inherits from Shape

Refined Object Model - Graphic Editor

initial

object-oriented-modeling---graphic-editor's People

Contributors

saif86 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.