CS102: Introduction and Review

Copyright © 1999, Kenneth J. Goldman

Computation


CS101 was primarily about computation:

We had "something" we wanted to compute and we worked out an elegant solution to compute it in software.

In a way, CS102 will build on CS101 by developing techniques for building larger-scale software systems.

However, CS102 is not primarily about computation

You may ask: If it's not about computation, why is it called computer science?

I'm glad that you asked. Good Question.

It's true that initially computers were built for computation (primarily military computation--computing cannon trajectories,cracking codes, etc.). But today, if you look at computer applications, computation (although still important) is beginning to take a back seat to something else:

Computation is taking a back seat to communication.

Communication

What is communication?
Definition - moving information and ideas fom one entity to another
What does Communication Involve
  • transfer involving two parties (source,destination)
  • common understanding on which communication is based.(may involve choice of language and common vocabulary and/or common experience) i.e. the information has to be "understood" by the recipient for communication to occur.
As it turns out, communication pervades all of software development. In fact, much of what we did in CS101 can actually be viewed form a communication point of view.

Communication and CS101

Unit of Computation Form of Communication Supporting(Related) Abstractions
calulation expression (source, destination) Java primitives
naming abstraction(through variables)
procedure above + parameters and return values (caller,callee) above + precedural abstraction [recursion,iteration]
object above + constructor parameters
method calls (fixed behavior)
above + class, interface, abstraction barrier
collection of objects above + method calls (behavior based on object type) above + class hierarchies, inheritance, polymorphism


Aside: In CS101, we looked at these things from the point of view of abstractions supporting larger and larger grain sizes. Inherent in that is also the communication issue, and we spent some of the time talking about communication (like how to pass parameters, and how to create interfaces to control object access). But, we dwelled more on the computation aspect, particularly with regard to algorithms and data structures, which are the foundation of all computation. However, in CS102, we'll see that as programs increase in scale, the communication aspect becomes the dominant theme.

Communication and CS102

Let's preview some of CS102 by continuing with this chart...

Unit of Computation Form of Communication Supporting(Related) Abstractions
Collections of loosely-related types of objects Application Programmer Interface (API) [protections become increasingly important]
  • multiple related class hierarchies
  • packages
Collections of objects that must cope with errors "Interruption" in the middle of a computation (occurs also in human communication...)
  • Exceptions
  • Exception class hierarchies
Applications that save and load persistent data on the local computer Disk I/O
  • Files
  • Streams
Applications that communicate with human users
  • Graphical User Interface (GUI)
  • Events (another kind of "interruption" different from an exception)
Event sources and listeners
Applications containing multiple concurrent computations tha communicate with each other.
  • Shared Object
  • Events
  • Threads
  • Synchronization
Applications that save and load persistent data accross the network Network I/O (asynchronous)
  • distributed file servers
  • TCP/IP, sockets
  • URL Connections
  • database servers
Applications that communicate with each other across the network Network I/O (synchronous)
client/server paradigm
group collaboration paradigm
  • sockets
  • remote procedure calls
  • distributed shared objects

Along the way, we'll also talk about design patterns, object-oriented techniques that are commonly used to handle recurring situations in various application paradigms.