






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
tài liệu lập trình hướng đối tượng bạn ko hiểu thì do bạn
Typology: Study Guides, Projects, Research
1 / 12
This page cannot be seen from the preview
Don't miss anything!
Lecturer: Teaching Assistant:
In this lab, you will practice with: ● Installing a design tool for UML diagrams: Astah ● Problem Modeling with Use-case diagram ● Encapsulation and different techniques for encapsulation ● Class design for use cases related to cart management ● Java Implementation: Creating classes in Eclipse, constructors, getters and setters, creating instances of classes
For this lab class, you will have to turn in your work twice, specifically: § Right after the class : for this deadline, you should include any work you have done within the lab class. § 10PM two days after the class : for this deadline, you should include the final use case diagram, the final class diagram, the source code of all sections of this lab, and the reading assignment in a directory namely “ Lab0 2 ”. Note that for the use case diagram, submit both source file (.astah) and its exported image (.png) in the folder namely “ Requirement ”; for the class diagram, also submit both source file (.astah) and its exported image file (.png) in the folder namely “ Design ”; for the reading assignment, submit an image file of the reading assignment in the folder namely “ ReadingAssignment ”, put all into a directory namely “ Lab02 ” and push it to your master branch of the valid repository. Note that all sample codes or diagrams in the lab are only the examples/suggestions. You may need to change them to satisfy the requirement. Each student is expected to turn in his or her own work and not give or receive unpermitted aid. Otherwise, we would apply extreme methods for measurement to prevent
within your repository.
The Unified Modeling Language (UML) is a family of graphical notations, backed by single metamodel, that help in describing and designing software systems, particularly software systems built using the object- oriented style (Fowler, 2003). Astah is a design tool which supports UML. To get Astah UML, go to http://astah.net/student-license- request, fill the form, and send the request. Then follow the 3 steps in the redirected page http://astah.net/student/thank-you. See use case diagram with Astah at http://astah.net/manual/422-usecase- diagram. Try to draw some several UML diagrams in the Astah UML, such as class diagram, activity diagram, sequence diagram.
based on the information that the user provides. This information can be displayed whenever the user decides to see it. The DVD with its information and functions is modeled with the DVD class. Finally, the application needs an entry point for displaying to and taking input from the user (via a command- line interface), which will be the Aims class. A sample class diagram is illustrated in Figure 2 , which includes 3 classes:
Figure 3. Create Aims class by Eclipse
Figure 4. Generated code for Aims class
Figure 5. Aims in default package
Figure 7. Generate getters & setters by Eclipse Figure 8. Choose appropiate accessors
Figure 9. Generated accessors
Figure 11. Setup for generating constructor using fields
Figure 12. A sample code for a generated constructor
Figure 13. Sample code of the Cart class