Docsity

Identifying & Applying Design Patterns in CAD/CAM Systems: Solving the CAD Problem - Prof., Study notes of Computer Science

Toggle sidebar
bg1
CS 350
CS 350 –
–Software Design
Software Design
Solving the CAD Problem with Patterns
Solving the CAD Problem with Patterns –
–Chapter 13
Chapter 13
Let
Let’
’s review the CAD/CAM Application Requirements
s review the CAD/CAM Application Requirements
Requirement
Requirement Description
Description
Read a CAD/CAM
Read a CAD/CAM My system must be able to analyze and extract
My system must be able to analyze and extract
model and extract
model and extract CAD/CAM descriptions of pieces of sheet metal.
CAD/CAM descriptions of pieces of sheet metal.
features
features The expert system then determines how the
The expert system then determines how the
sheet metal should be made and generates the
sheet metal should be made and generates the
required instructions so that a robot can make it.
required instructions so that a robot can make it.
Be able to deal with
Be able to deal with Initially, I am concerned with sheet metal parts.
Initially, I am concerned with sheet metal parts.
many kinds of parts
many kinds of parts Each sheet
Each sheet-
-metal part can have multiple kinds of features,
metal part can have multiple kinds of features,
including slots, holes, cutouts, specials, and irregulars.
including slots, holes, cutouts, specials, and irregulars.
Handle multiple versions
Handle multiple versions See following figure. You can infer that we need the
See following figure. You can infer that we need the
of the CAD/CAM system
of the CAD/CAM system ability to plug and play different CAD/CAM systems
ability to plug and play different CAD/CAM systems
without having to change the expert system.
without having to change the expert system.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe

Partial preview of the text

Download Identifying & Applying Design Patterns in CAD/CAM Systems: Solving the CAD Problem - Prof. and more Study notes Computer Science in PDF only on Docsity!

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Let Let’

’s review the CAD/CAM Application Requirements

s review the CAD/CAM Application Requirements

Requirement Requirement

Description Description

Read a CAD/CAM Read a CAD/CAM

My system must be able to analyze and extract My system must be able to analyze and extract

model and extract model and extract

CAD/CAM descriptions of pieces of sheet metal. CAD/CAM descriptions of pieces of sheet metal.

features features

The expert system then determines how the The expert system then determines how the

sheet metal should be made and generates the sheet metal should be made and generates the

required instructions so that a robot can make it. required instructions so that a robot can make it.

Be able to deal with Be able to deal with

Initially, I am concerned with sheet metal parts. Initially, I am concerned with sheet metal parts.

many kinds of parts many kinds of parts

Each sheet Each sheet-

-metal part can have multiple kinds of features,

metal part can have multiple kinds of features,

including slots, holes, cutouts, specials, and irregulars. including slots, holes, cutouts, specials, and irregulars.

Handle multiple versions Handle multiple versions

See following figure. You can infer that we need the See following figure. You can infer that we need the

of the CAD/CAM system of the CAD/CAM system

ability to plug and play different CAD/CAM systems ability to plug and play different CAD/CAM systems

without having to change the expert system. without having to change the expert system.

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

High Level View of the System High Level View of the System

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

What patterns exist in the CAD/CAM problem? What patterns exist in the CAD/CAM problem?

Abstract Factory Abstract Factory

Adapter Adapter

Bridge Bridge

Fa Faç

çade

ade

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Work through the patterns by context Work through the patterns by context

See which one creates the context for the others See which one creates the context for the others

Look for what creates context Look for what creates context

We can do this by brute force until we have a better intuition We can do this by brute force until we have a better intuition

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Chapter 13

What patterns create a context for other patterns? What patterns create a context for other patterns?

BY context we mean. Which pattern is senior over the other patte BY context we mean. Which pattern is senior over the other pattern. The senior pattern

rn. The senior pattern

constrains or defines the behavior of other patterns. constrains or defines the behavior of other patterns.

We can separate out the Abstract Factory until later as it creat We can separate out the Abstract Factory until later as it creates things. Unless we have

es things. Unless we have

multiple creation patterns, we can usually do this. multiple creation patterns, we can usually do this.

Note, as we developed designs, we never really worried about ins Note, as we developed designs, we never really worried about instantiation. I always said we

tantiation. I always said we

would wrap it up in something, that something became the Abstrac would wrap it up in something, that something became the Abstract Factory. This

t Factory. This

helps because it is always good to minimize the # of things in o helps because it is always good to minimize the # of things in our head during

ur head during

design. design.

The pairs left to consider are: The pairs left to consider are:

Adapter Adapter -

  • Bridge

Bridge

Bridge Bridge –

  • Fa

Faç

çade

ade

Fa Faç

çade

ade –

  • Adapter

Adapter

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Chapter 13

Specifically, we use the Adapter to encapsulate an Specifically, we use the Adapter to encapsulate an OOGFeature

OOGFeature so that it its interface

so that it its interface

can be converted to one that is expected. can be converted to one that is expected.

Specifically, the Bridge separates the abstract features from th Specifically, the Bridge separates the abstract features from the drawing system

e drawing system

implementations. implementations.

The Bridge will require the Adapter to modify the The Bridge will require the Adapter to modify the OOGFeature

OOGFeature.

Therefore, there is a relationship between the Bridge and the Ad Therefore, there is a relationship between the Bridge and the Adapter.

apter.

So does the Bridge provide a context for the Adapter or the Adap So does the Bridge provide a context for the Adapter or the Adapter provide a context for

ter provide a context for

the Bridge? the Bridge?

This should be obvious. The Adapter has no purpose without the B This should be obvious. The Adapter has no purpose without the Bridge, therefore:

ridge, therefore:

The Bridge provides a context for the Adapter. The Bridge provides a context for the Adapter.

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Let Let’

’s look at a basic solution

s look at a basic solution

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Generic Bridge Structure Generic Bridge Structure

Bridge Applied Bridge Applied

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

Solution is not yet complete. Look at the Cad implementations. T Solution is not yet complete. Look at the Cad implementations. They need more detail.

hey need more detail.

We need to apply the Adapter to V2 of the CAD system to simplify We need to apply the Adapter to V2 of the CAD system to simplify the interface.

the interface.

CS 350

CS 350 –

– Software Design

Software Design

Solving the CAD Problem with Patterns

Solving the CAD Problem with Patterns –

– Chapter 13

It turns out in this specific solution, we do not require a fact It turns out in this specific solution, we do not require a factory.

ory.

Since the Model knows what version of CAD is being utilized ther Since the Model knows what version of CAD is being utilized there is no need to create the

e is no need to create the

factory. factory.