Web Hosting Tomcat, Java, JSP, Servlets, J2EE, PHP, MySQL

Cheap web hosting provider

06
Jan

Object-Oriented Design with UML and Java acc :

Object-Oriented Design with UML and Java acc : Account Attributes theNumber=NAP123 theBalance=150 debit 50 : ATM Figure 1.6 Message from an ATM to an account object When a message is received by some recipient object then an action is performed. This action usually involves some or all of the values of the attributes representing the state of the receiving object. The action will also use any message parameters. The logic associated with this action is described by the method for the operation. The method refers to the algorithm that is applied when an operation is executed. The method for the debit operation applied to an Account object involves reducing the value of theBalance attribute by the actual message parameter value of 50. We have noted how transformer operations usually result in a state change to the receiving object, while enquiry operations merely request information from it. The only means of communication is a message sent from a sender to a receiver. In the case of an enquiry operation a secondary information flow is observed. Here, the sender is expecting a response from the receiver in the form of a return value. Occasionally, transformer operations also supply return values, say, to report to the sender that the designated task has been completed successfully. Be sure to recognize that a return value is not another message. Observe also the asymmetry of the messaging concept. The recipient object, when defining its operation s logic, does not concern itself with the object that is sending the message. Equally, the sender need not be concerned with how the operation is implemented by the recipient. As noted in the preceding section this greatly assists with the production of high quality software systems by the separation of these two concerns. 1.3 Classes: sets of similar objects An object-oriented system is characterized as a set of interacting objects. It is therefore common to have more than one object of any given kind. For example, a bank will certainly have a number of customer accounts each of which carries out the same actions and maintains the same kind of information. The single class Account (such as figure 1.5) could represent the entire collection of account objects (such as in figure 1.4). The class contains the specification and definition of its operations (methods) and its attributes. The actual accounts are represented by instances of this class, each with its own unique identifier (say, acc1, acc2, ). Each instance contains data that represents its own particular state. When an account receives a message to carry out one of its operations, it uses the method definition for the operation given in its class and applies it to its own attribute values. Figure 1.7 shows the Account class and two instances of that class. The instances have identifiers acc1 and acc2. The Account class has three services provided by the operations debit, credit and getBalance. The attributes maintained by every

If you looking for unlimited one inclusive web hosting plan please check unlimited web hosting website.

Comments are closed.

Home | About Us | Compare Plans | Standard Hosting | Business Hosting | Java Tomcat Hosting | Support | FAQ | Order Now!

Powered by Omnicus java hosting services. All rights reserved.
Entries (RSS) and Comments (RSS).