Skip to main content

CST 338 - Week 4

This week, our team worked on quite a difficult assignment, in my opinion, which embraced two out of the three cornerstone principles of object-oriented programming: polymorphism and inheritance.

Polymorphism, like the Greek roots its based on, roughly means "many forms" in English. This allows programmers to write code that is an interface for different data types, while in most cases achieving the same functionality. Consider a theoretical Shape class and all the classes that can inherit from it, such as the Circle, Square, Triangle, and Pentagon classes. All of these shapes have different numbers of points, lines, and algorithms used to draw them. However, by making each class combine its own data and code within the Shape class, a programmer could write a draw() method/function, and another program calling this draw() function could get the correct shape depending on the parameters used. Thus, this theoretical draw() method could have many forms, which is the defining characteristic of polymorphism.

We also worked with interfaces and incorporated one into our program this week for the first time in this class. A major difference between an interface is an abstract class is that an abstract class can implement functionality code-wise, while an interface only provides definitions for functionality. If you try to give a method header in an interface a body, every (properly working) Java IDE/compiler will spit out an error. However, abstract classes can do things such as implement constructors and lay out basic functions, something you can't do in an interface.

Writing the barcode scanner was a tougher assignment than our group expected because getting 2D array traversal whilst checking out of bounds errors and converting string chars to ASCII codes initially was difficult to get right on their own, more so working together as a final program. However, we managed to get it done and working as intended, and I am proud of my team's work and our results. 

Comments

Popular posts from this blog

CST 499 - Week 7

This week, our group finished recording and editing our capstone project video and prepared our presentation for the capstone festival. Although I wish the capstone festival was held in person (and it could not due to current circumstances), I am excited to show off our project and hard work to other computer science students, friends, and family. I hope they'll enjoy it and learn something cool while doing so. 

The Final Journal

It's the end of a long, four year journey, and what a journey it has been. I never thought I could pull off finishing my second bachelor's degree four years ago when I first went to that introduction to programming class at my community college. I would like to thank all the friends I've made along the way and the people who have helped me through the last two years. Although it was difficult at times taking class while working 40+ hours a week, I'm proud of myself for making it through. I don't think I'll be a student enrolled in classes anytime soon, but I'll always be a lifelong student. See you all around.

CST 499 - Week 3

This week, we finished our ILP portfolios and turned in the final versions of our resume and cover letter. My group also completed the first part of the capstone report. I'll admit that creating a portfolio showcasing my past work was not at the top of my priority list when I first started studying computer science, although at this point in my educational and professional career I've learned how important it is to have such a portfolio. Like other creative professions, having a solid body of work to show to a potential employer, or even for personal documentation is one of the best ways to display your talents as an engineer. Also, all the assignments I've completed during my academic career, both at CSUMB and elsewhere, have given me a good start to my portfolio. I tend to prefer classic, plain styling like  Brian Kernighan's  home page (he has a pretty nice portfolio too), although I've come to appreciate highly stylized portfolios that make use of WebKit ani...