New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Seminar in Database Systems

by: Dr. Elyssa Ratke

Seminar in Database Systems CMPS 280

Dr. Elyssa Ratke
GPA 4.0


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 7 page Class Notes was uploaded by Dr. Elyssa Ratke on Monday September 7, 2015. The Class Notes belongs to CMPS 280 at University of California - Santa Cruz taught by Staff in Fall. Since its upload, it has received 25 views. For similar materials see /class/182256/cmps-280-university-of-california-santa-cruz in ComputerScienence at University of California - Santa Cruz.

Similar to CMPS 280 at UCSC

Popular in ComputerScienence


Reviews for Seminar in Database Systems


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 09/07/15
Kim Bruce Williams College n leave at U ofCai jmla at Santa Cruz Luca Cardelli quotIf there is no 39self in a language then it is not objectorientedquot public class Squares private Framedkeci cute1 musr publ Willghan fd can 9 an 0 mow inr 17 int d7 on r v dx Lumenmovragr5lyl purnie void moveT0 ini y cinemavery er H Objects encapsulate state amp methods Subtyping Inheritance Selfreference Provides dynamic method invocation with more power Are objects more than records with function components What provides real power How can semantics and type theory help Focus on classbased OO languages like Smalltalk Eiffel amp Java Multimethod languages are quite different ass v39 k s FramedReet outer inner 12 lri lrore l Of inquot Jul IE nlll39 class Sqiia wai 1 FramedRect outer inner public SquaresLocation upleft int size DrawingCanvas canvas public void moveint dx int dy outer movedx dy inner movex dy public void uoveToint x int y I this movex outergetX outergety Squares fst new Squarescorner 10 canvas Squares snd new Squares middle 40 canvas II abjed s are references fstmoveTo2030 snd fst II snd amp t refer ta same abject sndmove3050 0 Classes serve many roles Types Generators of new objects Extensible to form new generators public void moveint dx outermovedxdy innermovedxdy public void moveToint x int y thismovex outergetx y outergety First naive view afabjects new Squares u this auter II na mentian afthis inner X move fundxdy thisautermave0 maveTa funxy thismave De nes mutually recursive methods public class ovalSquares extends Squares private Framedoval center public ovalSquaresLocation upleft int size DrawingCanvas canvas superupleft size canvas center new FramedOval lic void moveint dx int dy supermovedx dy 01d move centernovedx dy gt What happens to moveTo S cquot it c U539 lll 1lly u 0 Meaning of this is not bound in classes Semantics of moveTo changes indirectly in Sq new Squares 39 39 39 Ovalsquares sq 1 this SQthis 0 class Squares A this SQthis 0 egg new ovalsquares 0 class OvalSquares A this OSQthlS osq J this39 OSQthis39 meaning ofthis changed where OSQ extends SQ where super SQthis39 uses new tth39 in body 0 Objects formed as xed paints of SQ and OSQ 0 T lt U i any object of type T can extruding Ield masquerade as object of type U 0 More formally subsumptian rule bread BreadTp lling CheeseTp sauce SauceTp lt Recards withmn eld update anly operatian is f 39 s lling T lt U amp o T gt 0 U bread BreadType lling FoodType 0 Java Interfaces amp extension m CheeseTp lt FoodType l a lffS gtTand sSthen fsT 11 12 13 T1 T2 T3 WhenisS gt T ltS gt T l1T2isinltiliTiigigk If f S gtT and 55 need f s T I k S n and far all S i S k T ltT sT S gtT ltS gtT I S lt S and T ltT Contravariantfar parameter types avariantfar result types l 9 0 Java 4 doesn t allow any changes to types of methods in subclass 0 C ampJava 5 allow covariant changes to return types 0 Suppose you don t care if subclass gives a subtype Do you still need restrictions In Smalltalk subclass and subtype hierarchies sometimes reverse 0 Method type in subclass must be subtype of method type in superclass for safety Covariant change allowed in return type Conti avariant change in parameter type ObiTyPe m T i lt ObiTyPe m T i W k S n and for all S i S k T ltT assuming methods not updatable at runtime Method parameters can vary contravariantly return types covariantly class Example void m thisns T nS x class SubExample extends Example T39 nS39 x void newMeth i What is relationship of new type of n to old if want type safety 0 Methods must be meaningful in all possible subclasses classiImM VM lt MVIR lt I efn i x Nthis R x IR 39 M mii metb ads new Squares auter ref inner ref X Wm IrefJJ 39 M Minst I efn mave fundxdy instauter maveTa funxy ltinstfmgt mave Methad suite can be shared between objects ofsame type is 0 Fixed paints are key to understanding OO languages 0 Classes are extensible generators of xed points 0 Subtyping explains restrictions on subclasses Even though subtypng distinct concept 0 De ning this in Classi l m M this IRY X lR 39 M39 where M39 lt M IRY lt Iref 0 When return this hide instance variables this EIXX x x M ObjM39 but notice ObjM39 lt ObjM thus this ObjM where ObjM is type of objects of the class being de ned 19 Obj P 1 fWDPCH where obj ifm In objects methods fixed parameterized by suite of instance variables not this classiImM VM lt M VIR lt I efn i x AthisIR gtlt IR M m How do we type function returning this 0 But now we have lost information 0 If C has method m with body return this then C m0 0 If D extends Cthen inherited in still has type C m0 0 But dm0 really returns value of type D Binary Methods public class Node protected Tm ThiSCIass is type ofuthisu public Nodemuselass next thlsnext next 0 In previous example declare public void setNextmns Lisr newNeKt m v ThisClass this ext K 0 Also examples with parameters of type public Tm 2 ThisClass called binary methods return ext Subclasses There are type safety problems De ne publlc class DbleNode extends Node l l d l ass 7 0 EC 6 US 1 prev publlc vold breakItNode nl Node n2 n1 setNextn2 next Tlll ilssz prev pm V 1d 5mm lg mm l Let n be a Node and dn be a DbleNode super setuext newNext newNextsetPrevthls7 breakItdn 11 public In setprevmue r newPrev thmm newt Blows up when dn setNext n is execmad Need to rule out this code using type system Rewrite Node and DbIeNode to replace all occurrences ofThisClass by ThisClass can 39 IY send binary message to Obiea if public void breakltmNode nl Node n2 know Its exact type quot1 setNextn2 0 If obj has type T then value of obj has typeT but not a subtype More generally w type parameters could write public ltN extends Nodegt void breakItU N nl an n2 n1setNextn2 0 ThisClass is type of this 0 In semantics 39 Node JThisClassNdThisClass 39 DbleNode uThisClass39DbNdThisClass39 0 Thus ThisClass NdThIsCInss Node ThisClass39 DbNdThIsClnss DoubleNode 7 0 Veri cation can bene t from similar assumptions on this and ThisClass 0 Alternative Verify under closedworld assumption and copy inherited methods down Compositional approach is better SubjObsGrp ClassGroup class MySubect void addObserVerMyObserver myObs void notifyObservers procMyEvent myEvt class MyObserVer void notifyMySubec mySUb MyEvent myEvt class MyEvent 0 Wish to typecheck modularly no repeated typechecking of inherited methods 0 Typecheck methods of class C under assumptions that hold in all extensions this ThisClass ThisClass extends C Can prove soundness of type system a 0 Gets much more interesting when Allow type parameters eg GJ lntroduceThisType as interface of this LOO extension of G java 5 Allow mutually recursiveThisClasses in class Allows types and classes to be re ned simultaneously in typesafe fashion ChoiceSubObsGrp ClassGroup extends SubjObsGrp class extends MySubect String getltemo class extends MyEvenr String getltemo class extends MyObsel39ver void notifyMySubjen mySUb MyEvent myEvt myEvtgetltem


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"

Jennifer McGill UCSF Med School

"Selling my MCAT study guides and notes has been a great source of side revenue while I'm in school. Some months I'm making over $500! Plus, it makes me happy knowing that I'm helping future med students with their MCAT."

Steve Martinelli UC Los Angeles

"There's no way I would have passed my Organic Chemistry class this semester without the notes and study guides I got from StudySoup."


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.