BeansVsApps

BeansVsApps - adds this new kind of concept of a Java Bean....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Java Beans vs. Procedure Programs Object Oriented Programming is not really a "whole new way of looking at programming". Rather it is an extension to procedure programming done in languages like Cobal and C and PL/I. And the extension that OO provides is the concept of a "business object", called a Java Bean, that encapsulates (protects and provides access to) the data associated with an object in the business. Java Beans are just data-centered. A Java Bean called Truck would keep all the data for a Truck, like it's milage, gas level, horsepower, hauling capacity, driver, manufacturer, etc. but would NOT include procedures/processes for Trucks like buy a truck, sell a truck, do maintenance on a truck, wash a truck, schedule a truck, etc. This sort of function is specified by "business algorithms" in our company and is the responsibility of procedure programs. So, yes, Object-Oriented programming still includes procedure programs! And OO
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: adds this new kind of concept of a Java Bean. Both procedure programs and Java beans are implemented using the Java language. (In the EJB world, application programs are called "session" beans and the data beans are called "entity" beans.) Attributes of Java application code vs. Java Bean Code Java Beans • Java Bean class has a NOUN name (Truck, PurchaseOrder, Customer. ..) • Data fields need to be SAVED externally when not in use in memory. • Code is mainly "getter and setter" methods to retrieve and update the data • Has a toString() method to "introduce itself" - show all data. • has no main() method Procedure Programs in Java • Class name is a VERB (Billing, PersonnelUpdate, TruckScheduling) • Data fields are used only during processing and are not saved. • may have a main() method • Implements "business processes" like Cobol programs do.(Schedule Trucks) • Uses Java Beans...
View Full Document

This note was uploaded on 01/25/2010 for the course ECE 309 taught by Professor Bowman during the Spring '09 term at N.C. State.

Page1 / 2

BeansVsApps - adds this new kind of concept of a Java Bean....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online