Tuesday, April 2, 2019

CST 338 M4 Software Design

Give an example of polymorphism and what what be inherited between classes.
After the learning this week, can you identify the difference between Abstract classes and Interfaces?  Be specific.
Update your learning journal from what you experienced this week with class. 

An example of polymorphism is when many meanings can be attached to one method through late binding/dynamic binding which allows a method in a base class can perform a task even if the task isn't defined. In the powerpoint, the example of Sale and DiscountSale was given. Due to the properties of polymorphism, the Sale class was created and the DiscountSale class with the bill() method did not exist.

         The difference between abstract classes and interfaces is that interfaces can only contain abstract methods, while an abstract class can have default, static, abstract, and non-abstract methods. In an interface, variables are either final or static compared to an abstract class where it can contain final, static, non-static, and non-final variables. The parts in a java interface are public by default, and the abstract class has variables and parts such as private and protected. An abstract class can provide the implementation of an interface where the opposite is not true. An interface can extend another interface where an abstract class can extend other classes and implement multiple interfaces. A java interface is implemented using "implements" and an abstract class is extended with "extends".


         This week, we learned about how to use polymorphism, interfaces, and abstract classes in our Barcode Scanner project. We also learned about UML diagrams in the same project. UML diagrams are software design tools for designing and documenting that can be used in any OOP language. We also learned about the software lifecycle and processes from UML diagrams because they can be used to show a team what functions and variables are used and how each class relates to another. 

No comments:

Post a Comment

cst 499 week 8

This week, we finished writing the paper in order to do the best job possible even if it was a little bit late. Now that everything is done,...