Tuesday, April 16, 2019

CST 338 Software Design M6

What experience do you have with UML diagrams?
Are they used at your workplace?
Have you done multithreading in any language before?
Did you find Patterns to be helpful?
Update your learning journal from what you experienced this week with class.


I have some experience with UML diagrams from my Java 2 class at Merced College.

I don’t work as a professional.

I have not done any multithreading before but I do see its practical use.

Patterns do seem helpful.


This week, we learned about how to code Multi-threading into a project. Multithreading is where multiple pieces of data are being processed at one time, parallel to each other in theory but taking turns in reality.  In multithreading, Thread.sleep is used to pause a thread. The thread class has objects called threads. It includes run and start that starts the processing. A thread can also be made by implementing the Runnable interface which needs to be from an instance of Thread, so pass the Runnable object to the thread constructor. In multithreading, threads that share a variable can end up with the wrong value, this is called a race condition and is fixed by using the Counter class. Thread synchronization is where threads are forced to wait so another can run. The sections with these issues are called critical regions so use the keyword synchronized to only run one thread at a time.


We also learned how to apply a design pattern in a programming project. Our class used the Model-View-Controller Design pattern. In an MVC pattern, the input and output of a task are separated from the rest of the application. The model is the container, the view is the picture and the controller is the input. There are other patterns such as the Container-Iterator pattern where an object holds multiple pieces of data, the construct iterates through the container. The Adaptor pattern is there one class is changed by adding an interface.

Tuesday, April 9, 2019

CST 338 M5 Software Design


GUI is learned late in the game with Java. Do you think this is helpful or harmful and why?
Why do think that coding the Swing elements in Java would be more difficult compared to some other languages?
Update your learning journal from what you experienced this week with class.
I don't think it is harmful to learn GUI later in Java. It is essential to learn the basics and build on those. Knowing object oriented programming makes larger projects easier because of its reusability. In my App-Development class we learned how to use GUIs but they were largely drag-and-drop. Aside from the use of mouse and click listeners, they are similar.
I am not familiar with the Swing elements equivalents in other languages. If there are libraries, it will probably be no issue. In Python, there are many GUI frameworks like TkInter and other cross platform options like Jython, an implementation of OOP in Python integrated with Java and PyGame, an introduction to game programming. According to some guy on Stackexchange, Java needs to be installed on the computer for it to work, MacOSX has some issues occasionally with it, multi-threading isn’t compatible with it, and the knowledge doesn’t transfer to UI development in other languages.This week, we learned about Swing and Event-Driven programming. Swing is a package that is a better version of the Java Abstract Window Toolkit but doesn’t replace it and is sometimes needed to use Swing. Event driven programming is a form of OOP that uses an event to signal a listener. We also learned about User Interface design by analyzing layout managers, using menus, buttons, text fields, and text areas in GUI programs. A layout manager describes how the components are arranged which include BorderLayout, FlowLayout, and GridLayout. A menu is a, object of the class JMenu filled with menu items which is identified by a string and displayed. A button is from the class JButton which is derived from the abstract class AbstractButton. Objects from the Dimension class are used with buttons and other objects to specify a size in pixels. TextFields are objects from the JTextField class which are used to enter one line of text. Text areas are objects from the JTextArea class and are used to enter multiple lines of text which can be line wrapped using the setLineWrap method. TextFields and TextAreas can be made uneditable using .setEditable(false or true).

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. 

Tuesday, March 26, 2019

CST 338 Software Design

What is the largest multi-dimensional array that you have used?
What is the largest that you think would be unwieldy and why?
What does inheritance do for your classes?  Have you used it in the past? How?
Update your learning journal from what you experienced this week with class. 

The largest multi-dimensional array I used was for making a dictionary. If I remember correctly, it had about 50,000 entries. The largest array that is unwieldy depends on the user's computer. If it takes too long to update or read, then it is unwieldy. Inheritance allows for classes to become more useful by adding more instance variables and methods. I have used inheritance in a JWindow app during my Programming II class. I didn't fully understand it until I read ch7.


         This week, we learned about references and class parameters. We also learned more about arrays and references. Arrays are objects that hold the address of where it's object is in memory. It is considered to be a class type. Finally, we learned about design and implement inheritance. Inheritance is a basic tenet of OOP, reusabulity, which include a general form of a class, with specialized versions of the same class added later on. The specialized classes inherit the methods and instance variables of the general class. 

Tuesday, March 19, 2019

CST 338 Software Design

OOP is not in all languages.  Have you used one that does not?
What was your experience?
How extensively have you used OOP outside of the classroom?
Are you experience with UML diagrams and do they help?
Update your learning journal from what you experienced this week with class. 

I have not used OOP when I was learning ActionScript3 in my Adobe Animate CC class. It was an introductory class where Programming II was not required. If I had more knowledge of it, my final project program would have been a lot shorter than 1000 lines. My project was a basic recipe book/app of my favorite recipes separated into different categories like main or side dish, then into various meat or vegetable dishes for main or side dish. A lot of these functions were exactly the same except for the text. I have not used much OOP outside of the classroom. I don't have industry experience yet and my whiteboard interview studies don't include much use of it.
I learned about UML diagrams and used them for a few projects in Programming II. The book we learned from was Intro to Java Programming by David Liang. UML diagrams are informative because they describe the class, data fields, constructors, and relevant methods including data types.
This week, we learned about how to create Object Oriented Programming classes which feature abstraction, inheritance, polymorphism, and encapsulation. OOP allows code to be reused in many ways. We learned about how to use constructors and overload methods. We used arrays and the ArrayList class. An array is used to store a collection of data of the same type. ArrayLists can store objects. We also used static methods and static variables. Static methods can be called without creating an instance of the class and static variables can be accessed by all methods in the class. 

Tuesday, March 12, 2019

CST 338 Software Design

Have you used Eclipse before?
What languages are you proficient in at this point?
What is your desired field of Computer Science at this point?
Update your learning journal from what you experienced this week with class. 

I have used Eclipse before in my programming I and II classes at Merced Community College. I believe I am proficient in Java and almost as much in Python now. I'm still not as good at programming as my classmates, however. My desired field of Computer Science is to work with Mobile Apps. I have made parts of a very basic studying app at a Mini-Hackathon in Stockton using Android Studio which was similar to the WindowBuilder plug-in from Eclipse which we learned in programming II. I had difficulty using it partly due to mostly using the GUI to design the app, my laptop screen is small, and the compile time was long. I use a computer with a larger screen and better specs at home.


This week, we learned how to install Eclipse. I deleted it off of my computer and changed my windows 10 username in a major way. I had to delete some temp files because it was still referencing my old username. Fortunately, I got it to install. We used a few built-in functions from the String class to print in all upper and lower case. We also used the Scanner class to read in from the keyboard. 

Friday, March 1, 2019

Week 23: Intro to Database Systems

Over the course of the past 8 or so weeks, we learned many things. We learned about the reasons for using a database, parts, characteristics, and the software we needed to use databases namely the MySQL workbench. We used HTML to enter data into a database using Python. Which was convenient because we learned Python in the previous class. We learned the basics of retrieving data from one table with joins and subqueries to retrieve data from more than one table. We learned how to modify tables using insert, update, and remove. Our class used predicates like where to filter information and order by, group by, and having to sort data rows. We studied E-R diagrams and made them from existing database designs with normalization rules to make our databases more functional. We studied data warehousing, extract transform load, and star schemas. We learned about space management in databases using indexes and balanced trees to make database search faster. We studied ACID features of databases, using locks, versioning, and strategic locks to balance trade-offs. We learned how to do rollbacks and recovery when mistakes are made. In the end, we learned about scaling up databases, sharding, and database clusters when working with large amounts of data. The most important thing I learned was to ask for help when I needed it or I don't learn anything.

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,...