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

Info icon This 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
Image of page 1

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

View Full Document Right Arrow Icon
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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern