15
1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah : T0604-Pengantar Teknologi Informasi Tahun : 2008 Versi : 2.0/0.0 Williams, B.K, Stacy C. Sawyer (2007). Using Information Technology: A Practical Introduction to Computers & Communications. Seventh Edition, McGraw-Hill, New York. ISBN-13: 978-0-07-110768-6 Sumber: Chapter 10. System Analysis & Programming: S/W Development, Programming, & Languages, p.497

1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

Embed Size (px)

Citation preview

Page 1: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

1

Pertemuan 26

Bahasa-bahasa Pemrograman (Lanjutan)

Matakuliah : T0604-Pengantar Teknologi Informasi

Tahun : 2008

Versi : 2.0/0.0

Williams, B.K, Stacy C. Sawyer (2007). Using Information Technology: A Practical Introduction to Computers & Communications. Seventh Edition, McGraw-Hill, New York. ISBN-13: 978-0-07-110768-6

Sumber: Chapter 10. System Analysis & Programming: S/W Development, Programming, & Languages, p.497

Page 2: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

2

Learning Outcomes

Pada akhir pertemuan ini, diharapkan mahasiswa

akan mampu :

• menjelaskan cara kerja pemrograman berorientasi obyek dan pemrograman visual, serta apa yg dikerjakan bahasa markup dan bahasa scripting (C2)

Page 3: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

3

Outline Materi

• Object-Oriented & Visual Programming

• Markup & Scripting Languages

Page 4: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-4

Object-Oriented & Visual Programming

• In Object oriented Programming (OOP) data and processing instructions are combined into an object that can be reused– Object

• Self-contained module consisting of reusable code

– Message• The instruction received by the object indicating it is time to

perform an action

– Method• The processing instructions within the object to perform the

specified action

Page 5: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-5

Object-Oriented & Visual Programming

• Black Box – Objects are like a black box in that the

actions and the objects are specified, but

the methods used are internal to the object– This means the programmer that uses an object does not

need to know how the program inside the object does what it does

– For example, Microsoft Excel is like an object• Most of us use Excel without understanding what the programmers

at Microsoft did to make Excel work

• If we had to know that, it would take a lot longer to learn how to use Excel!

• Programmers who use objects can write programs a lot faster, because objects save so much work

Page 6: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-6

Object-Oriented & Visual Programming

• 3 basic concepts of OOP– Encapsulation

• One object contains (encapsulates) both – Data– Relevant processing instructions

– Inheritance• One object can be used as the foundation for other objects• Objects can be arranged in hierarchies – classes and

subclasses• Objects can inherit actions and attributes from each other

– Polymorphism• Allows a single definition to be used with different data types

and different functions• Means a message produces different results depending on

the object it is sent to

Page 7: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-7

Object-Oriented & Visual Programming

DoorsHave a Handle

openclose

Patio doorsHave a slider

slide openslide closed

Front doorsHave locks

Car doorsHave locks

Have windows

The “Door” class

Actions performed by

a door

Subclasses of doors inherit from the door class, but also have their own unique actions and attributes

Notice we only list the actions & attributes when they differ from those of

class

Example of Inheritance Hierarchy with Specialization

Page 8: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-8

Object-Oriented & Visual Programming

• Visual Basic is an example of visual programming– Using a mouse, the programmer drags and drops

objects on screen– The objects are arranged to make up the graphical

user interface for the program being written– By double-clicking on those objects, the programmer

can get into a coding window and write the programs to control the actions and behaviors of those objects

– This makes it fast and easy to build prototype user interfaces and get end-user approval before doing a lot of programming

If you have Visual Basic installed on your school’s computers, this would be a great time to try it out.

Page 9: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-9

Markup & Scripting Languages

• A markup language is a kind of coding or “tags” inserted into text that embeds details about the structure and appearance of the text.

• Open up a text editor such as Notepad or Wordpad, and enter the following text:

• Then save the file on your desktop. Name it sample.htm• Now open your internet browser and view it by clicking “file open”

and navigating to your desktop

<body bgcolor = "yellow"><h2> <p>My name is </h2><b><i><font color=“red”>your name</font></i></b></p>And I <b><h1>love</h1></b> this class!!!</body>

Page 10: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-10

Markup & Scripting Languages

• So how did this• Turn into this?

• By HTML tags

<body bgcolor = "yellow"><h2> <p>My name is </h2><b><i><font color=“red”>your name</font></i></b></p>And I <b><h1>love</h1></b> this class!!! </body>

My name is your name

And I

lovethis class!!!

The <body bgcolor = “”> tag defines the page color

The <h2> tag means a heading of size 2

The <h1> tag means a heading of size 1

The <i> tag means to italicize the text

The <b> tag means to bold the text

The <p> tag means to start a new paragraph

And the / inside a tag means to end that format

There are a LOT of other HTML tags

Page 11: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-11

Markup & Scripting Languages

• HTML – Hypertext markup language– Used to create web pages– Also lets you insert a hypertext link in a web page

• VRML– Virtual Reality Modeling for Markup Language is used

to create three-dimensional web pages including interactive animation

– Requires special VRML browser to view those pages

Page 12: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-12

Markup & Scripting Languages

• XML

– eXtensible Markup Language is a metalanguage written in SGML that allows one to facilitate easy document interchange on the internet

– XML lets you create your own tags

– XML statements define data content

• JavaScript

– Not the same language as Java

– An object-oriented scripting language that adds interactive functions to web pages

Page 13: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-13

Markup & Scripting Languages

• ActiveX– Developed by Microsoft as an alternative to

Java for creating interactivity on web pages– A set of controls or components that enable

programs or content of almost any type to be embedded in a web page

– Often used by crackers to propagate viruses and/or trojans

– Before you allow an ActiveX component to download from your browser to your PC, make sure you trust that website!

Page 14: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

10-14

Markup & Scripting Languages

• Perl– A general-purpose programming language

developed for text manipulation.– Developed in 1987 by Larry Wall– Now used for web development, network

programming, system administration, GUI development, other tasks

– Widely used for web server programs to perform automatic tasks such as updating user accounts and newsgroup postings

Page 15: 1 Pertemuan 26 Bahasa-bahasa Pemrograman (Lanjutan) Matakuliah: T0604-Pengantar Teknologi Informasi Tahun: 2008 Versi: 2.0/0.0 Williams, B.K, Stacy C

15

Kesimpulan