Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
se2aa4_cs2me3
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
W. Spencer Smith
se2aa4_cs2me3
Commits
91c52b7d
Commit
91c52b7d
authored
7 years ago
by
W. Spencer Smith
Browse files
Options
Downloads
Patches
Plain Diff
Initial updates to L13 on module decomp - exceptions, assumptions, qualities of design
parent
03ebddd8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf
+0
-0
0 additions, 0 deletions
Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf
Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex
+95
-0
95 additions, 0 deletions
Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex
with
95 additions
and
0 deletions
Lectures/L13_ModuleDecomposition/ModuleDecomposition.pdf
+
0
−
0
View file @
91c52b7d
No preview for this file type
This diff is collapsed.
Click to expand it.
Lectures/L13_ModuleDecomposition/ModuleDecomposition.tex
+
95
−
0
View file @
91c52b7d
...
...
@@ -13,6 +13,8 @@
\usepackage
{
booktabs
}
\usepackage
{
listings
}
\useoutertheme
{
split
}
%so the footline can be seen, without needing pgfpages
% \pgfpagesuselayout{resize to}[letterpaper,border
...
...
@@ -36,6 +38,9 @@
\input
{
../footline
}
\lstset
{
language=python, breaklines=true, showspaces=false,
showstringspaces=false, breakatwhitespace=true, texcl=true, escapeinside=
{
\%*
}{
*)
}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
...
...
@@ -98,6 +103,96 @@ TBD
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
[fragile]
\frametitle
{
Example Subclass Exception in Python
}
\ttfamily
\begin{lstlisting}
class Full(Exception):
def
__
init
__
(self, value):
self.value = value
def
__
str
__
(self):
return str(self.value)
\end{lstlisting}
\sffamily
Example of raising the exception
\ttfamily
\begin{lstlisting}
if size == Seq.MAX
_
SIZE:
raise Full("Maximum size exceeded")
\end{lstlisting}
\sffamily
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Exception Signaling
}
\begin{itemize}
\item
Useful to think about exceptions in the design process
\item
Will need to decide how exception signalling will be done
\begin{itemize}
\item
A special return value, a special status parameter, a global variable
\item
Invoking an exception procedure
\item
Using built-in language constructs
\end{itemize}
\item
Caused by errors made by programmers, not by users
\item
Write code so that it avoid exceptions
\item
Exceptions will be particularly useful during testing
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Assumptions versus Exceptions
}
\begin{itemize}
\item
The assumptions section lists assumptions the module developer is
permitted to make about the programmer's behaviour
\item
Assumptions are expressed in prose
\item
Use assumptions to simplify the MIS and to reduce the complexity of the
final implementation
\item
Interface design should provide the programmer with a means to check so
that they can avoid exceptions
\item
When an exceptions occurs no state transitions should take place, any
output is
{
\it
don't care
}
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Quality Criteria
}
\begin{itemize}
\item
Consistent
\begin{itemize}
\item
Name conventions
\item
Ordering of parameters in argument lists
\item
Exception handling, etc.
\end{itemize}
\item
Essential - omit unnecessary features
\item
General - cannot always predict how the module will be used
\item
As implementation independent as possible
\item
Minimal - avoid access routines with two potentially independent services
\item
High cohesion - components are closely related
\item
Low coupling - not strongly dependent on other modules
\item
Opaque - information hiding
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle
{
Assumptions versus Exceptions
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment