smalltalk primer session

Download Smalltalk Primer Session

Post on 05-Feb-2016

32 views

Category:

Documents

1 download

Embed Size (px)

DESCRIPTION

Smalltalk Primer Session. skrishnamachari: LFY article + slides print out Paper + pencil for notes taking Marker Feedback forms Try networking 2 systems. Sudhakar Krishnamachari Cincom Systems Pvt Ltd December 2004. Projects: Software or any other A Typical Scenario…. - PowerPoint PPT Presentation

TRANSCRIPT

  • Smalltalk Primer Session

    Sudhakar KrishnamachariCincom Systems Pvt LtdDecember 2004

    skrishnamachari:LFY article + slides print outPaper + pencil for notes takingMarkerFeedback formsTry networking 2 systems

  • Projects: Software or any otherA Typical Scenario.

    Changing or undefinedCustomer requirements Incomplete effort at Design stage Not so perfect execution Time overruns Cost overruns Customer dissatisfactionAnd so on. Tools herein are only aids to experience, process and commitmentWhat is Smalltalk.?

  • Introduction to Smalltalk: upto Slide 16 1 hour

    Ease of learning Smalltalk and OOPS through Smalltalk 5 min..

    Delivering Value in Smalltalk: Slide 17 15 min

    Live demo with Smalltalk: 30 min

    Concluding Note: 10 min..

    Q&A 15 30 minSession Contents:

  • A Language

    An IDE

    Team Dev environmentversion controlled code sharing automatically linked..

    ToolSet for comprehensive app analysis: Time/ Space profiling

    Framework for various technologies.name a few..? COM, .Net, CORBA, WebServices etc..

    It always comes bundled, not just as a language in its various dialects

    A Whole new ( or the oldest ) paradigm!!!

    Above all the test bed for many of the CS concepts we hear today:

    MVC, UI framework, XP Programming, Sunits, Design Patterns, Distributed Computing, comprehensive uniting of garbage control, bytecode and VM based dev platform etc

    Article on Linux and Smalltalk applicable though for any OSSmalltalk is a comprehensive tool box for the developers

  • Why the move into Smalltalk:

    Project time comparison: C Project (xdelta) 12 weeks.. Java ( file system) 6 + 6 weeks.. Smalltalk (Pathfinder) 3 weeksSession Objectives:Smalltalk as a value proposition for a software development unit(Learn all other languages/ dev platform and realize why smalltalk!!)This is a two way interactive sessionPut Smalltalk in its right perspective..Skrish personalPast: Fortran,C, C++, VC++Introduction

  • Introduction contd

    Smalltalk Presence: The biggest presence is the acceptance and emergence of Bytecode based, garbage controlled, OS/DBMS transparent, MVC based UI and Virtual Machine based language/ development platforms: Java or .Net

    Corporate: Was 17% of US market in mid 1990s Academic: Small but significant in its love and ease in teaching OOPS Still strong in lots of cos in the Insurance, Shipping, banking, manufacturing, trading, scientific sectors of programming..A Renewed interest and thrust this 2002 onwards.. Telecom: > a billion $ project for British Telecom Shipping: > 50% of world trade software runs on Smalltalk Insurance: Many insurance companies have significant code in Smalltalk Finance: Kapital from JP Morgan trades derivatives that other languages cannot

    Regional interests: Entire Deutsch Bahn, Swiss banks, manufacturing units run on Smalltalk. Significant Japanese interests in VisualWorks usage

    Other dialects/implementationsVisualAge, VisualWorks, Squeak, GNUSmalltalk, Dolphin/SmalltalkMT, Object Studio, Smalltalk X, OOSVM etc.

  • Show progression to Smalltalkas realized by Alan Kay

    * Starts with on-off gates in electronics to 0-1 in binary: all about raw computing.* Moves on to Assembly language of programming instructions mov, mul, add, jump, sub, loop, etc...* The wakening of easier grammer: Basic and the predecessorsRead , Print, etc....* Move over to the procedural paradigmfunction oriented Fortran and others... C ....a system language finally... Smalltalk is born from: LISP: The string interpreter for languages...views everything as a collection of characters.. entities Simula: The real world object syntax and as recursion on objects. First OOPS languageIvan Sutherlands paper on UI based, mouse controlled computing system

    Real life is made of objects... and divisible into objects nearly ad-nauseum so is Smalltalk the language/ IDE modelled with Object hierarchy now adopted across all dev platforms

    Binary 0/1 sAssemblyProcedural: C / BasicObject OrientedSequential: COBOLGrammer of Programming Languages

  • The move is steadily to make programming languages as easy as you and me talk...but powerful enough for the computer to understand..you cannot be fuzzy as we are in real English and hope the computer to be using that as of now..

    In English: as you would say: so would you in Smalltalk!!..Object move, Ball thrown, aCar isDriven, Train runsOn rails

    Smalltalk function call on a class or Object: Aircraft from: BritishAirways flysTo:London atTime: 230AM . simple isnt it

    Others languages Java/ C++:Aircraft.aircraftFlightDetails ( BritishAriways , London , 2.30AM );

    Its all about nouns, adjectives, verbs.a parallel captured in OOPS

    Read and write in language you understand, in the manner you speak or write..And above all see it in UI not as passive set of code filesSmalltalk, the first true OOPS language/environment: 1972-80

  • What are Objects, Classes and Object Oriented ProgrammingObjects: Real World Entities mapped as programming construct computers can understand.

    Classes: Collection of functions and the relevant local data for these functions. Extend from your knowledge of C: all functions declared are global, all data used from more than 2 functions ends being global So if say 4-10 functions are logically doing one unified functionality, and say 10 data variables are used by these functions. Combine these functions and data description: one logical unit in memory now called Class XYZ.: This is Encapsulation

    anObject: Instance of a Class ABC. Create a link to the class structure in memory, Initialize all values of the class local variables in this objects allocated memory area. Invoke a function call on the object using these variable values. If you have 20 objects of the same class they will have 20 copies of their variable values but point to the same class memory area for execution of functions.CLASS XYZ

    DESCRIPTION OF LOCAL VARSVALUE OF CLASS VARS

    FUNC01: ALL INSTRUCTIONSFUNC02:FUNC03:So on..anObjOfXYZ01

    VALUES OF LOCAL VARSVAR1, VAR2, VAR3 .

    Ptr to Class XYZanObjOfXYZ02

    VALUES OF LOCAL VARSVAR1, VAR2, VAR3 .

    Ptr to Class XYZanObjOfXYZ03

    VALUES OF LOCAL VARSVAR1, VAR2, VAR3 .

    Ptr to Class XYZ

  • CLASS XYZSub01

    DESCRIPTION OF LOCAL VARSVALUE OF CLASS VARS

    FUNC10:FUNC11:CLASS XYZSub02

    DESCRIPTION OF LOCAL VARSVALUE OF CLASS VARS

    FUNC20:FUNC21:CLASS XYZSub03

    DESCRIPTION OF LOCAL VARSVALUE OF CLASS VARS

    FUNC30:FUNC31:CLASS XYZSuper

    DESCRIPTION OF Common LOCAL VARSVALUE OF Common CLASS VARS

    FUNC01:Inheritance: Extract the common functions and data to a super class Thus create a hierarchy of super, sub classes and sub-sub classes etcThere are other features that are simply further simplification or in a way optimizing the functionality of the language which are:

    Polymorphism: Literal: Multiple shapes visible of one entity . In programming it implies a function name that is common within a class or in two class but has differrent code section to execute, but similar meaning in execution.Data Hiding: This is an automatic feature as variables are now within a class memory structure and only that class or its sub class can access it

    One step further you can talk of Abstraction too.. Think further on:

    Object Aggregation or Composition and Object Inheritance creating a pool of interacting Objects in memory to create a program.!!...

  • Smalltalk Conceptualization from Simula, LISP and Ivan Sutherlands paper 1968: Alan Kay at XeroxSmalltalk 72: Conceptual Smalltalk 76: Bytecode, VM, LISP features incl garbage collection etc..Smalltalk 80: First formalized release of the Smalltalk specs, incl the PS VM, virtually all known core features of the language + basic IDE to program in

    Philosophy of the Smalltalk Design:Dan Ingalls: Keep it simple, keep it stupid

    Carry over to Macintosh of window/GUI and then into M$oft Windows..HP for distributed SmalltalkIBM for VisualAgeXerox hives of to Parcplace Smalltalk or VisualWorksDigitalk Smalltalk that later merges with VisualWorksSqueak in Disney still maintained by Dan Ingalls and others..1999: Cincom takes over VisualWorks2005: VisualWorks 7.3 is the new workhorse potentially competing with Java Websphere History of Smalltalk Development

  • Everything is an object: No primitive data types or primitive operations exposed to user

    1.It is a dynamically typed language: No instantiation of variable types at declaration Runtime assignment of type, thus variables can be of any type right through the program. [The future of all languages that exist now..as Stiffly Typed ]Language Syntax: A different syntax to code with, no curly braces, no function params in closed brackets, plain camel case instead of Hungarian notationIDE based live coding: The program is coded within the running application environment. That is