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.

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