Category Archives: Week 1

Blog Discovery

Michael Feathers is a software developer, founder, and director of R7K Research & Conveyance. R7K Research & Conveyance is a company located in Miami Florida. Specializing in software design, they use the importance of the need of the business and intensive planning to meet company demands, plus on top of that to be able to design software where you are aware of the code to make adaptable adjustments in the long run such as, adding new features that are newly needed vs features that are easily removed to make room for new upcoming changes which is referred to as planning. 

He helps other teams and developers to refactor code to improve its performance without rewriting the existing code. Gives best practices to maintain their software with ease such as making test programs as you can optimize it at the same time to keep tabs on it. 

I chose this blog because he provides helpful tips whether they are in Java, Python, C++, etc. and leaks information from his Book “Legacy Code”. Also mentions UML which I could learn more in depth of when we progress further into CS-343. 

In one of his blogs about code refactoring, he discusses that before we make tests for our own code we write, we must evaluate and rethink towards ourselves whether if it is going to fail. He stated, “As you make any change, know with every edit whether that edit changes behavior.” https://michaelfeathers.silvrback.com/testing-yourself, meaning we can’t compile code if it is incomplete, if there is something going wrong, we must figure out the missing piece of the puzzle. I could’ve used this type of thinking back in my other core classes like Data structures, or intro to programming class, because it can only take a small mistake to make your entire code and/or program to fail. Another reason is that Michael gives an example about when working in groups, and the type of challenges you may face such as having trouble putting heads together, not seeing each other’s perspectives. Providing tips and trick to get around obstacles like these. In CS-343, we do POGIL activities when we come into class, each member has roles of their own to keep the teamwork intact, but as he exemplified before we may also “glitch” and we have to figure out why and what can do about it. Depending on how we think and how we get ideas.

Reference blog resource: https://michaelfeathers.silvrback.com , https://www.r7krecon.com

From the blog cs@worcester – Dahwal Dev by Dahwal Charles and used with permission of the author. All other rights reserved by the author.

Design Principles

The four fundamental ideas of Object-Oriented Programming are Encapsulation, Abstraction, Inheritance, and Polymorphism. OOP allows programmers to approach software development as if they were dealing with real-world objects. People in real life have the skills and expertise to do a variety of tasks. Objects in OOP feature fields for storing knowledge, state, and data, as well as the ability to perform a variety of operations. The basic terms we need to know before getting more into OOP are Object, Class, Method, and Instance.

Object – A class’s instance

Class – A model that describes an object’s functionality

Method – Changing the state of a class applies to all other instances of the class

Instance – Is similar to an object. The blueprint used to build the product is an instance of the class.

Let’s move on to the four fundamental ideas of Object-Oriented Programming:

Encapsulation

When objects are encapsulated inside a class, they each have a private state. Other objects can’t directly access this state, but they can only use a list of public functions to get at it. These functions allow the object to control its own state and no other class has access to it unless access is granted. As a developer, you must use the given ways to communicate with the object. The state of a class invoked by a method created a bond between the private state and public methods.

Abstraction

Abstraction is a continuation of encapsulation. To show just relevant information to an object, data is selected from a large pool. Abstraction is the technique used to get, remove, or select user data from a bigger pool. In the case of abstraction, you can use the same info gathered for a different app to power other programs with little or no coding changes.

Inheritance

Inheritance is the process through which one object gains access to all of the properties of another without actually changing anything about the original. For instance, a child gets personality qualities from both of their parents. Reusability is a significant benefit of inheritance. The existing class’s fields and methods can be reused. Inheritance might be single, multiple, multilevel, hierarchical and hybrid, in Java.

Polymorphism

Polymorphism makes it possible to utilize a class in the same way as its parent, which eliminates the possibility of confusion. As a result, each child sub-class retains its own functions and methods. Each of the child sub-classes should have unique variations.

In a conclusion, Object-Oriented Programming refers to programming languages that use objects. The goal is to implement real-world concepts, keep data and the functions that operate on it separate such that no other part of the code may access it, except for that function.

References:

https://info.keylimeinteractive.com/the-four-pillars-of-object-oriented-programming

https://www.geeksforgeeks.org/understanding-encapsulation-inheritance-polymorphism-abstraction-in-oops/

From the blog CS@worcester – Xhulja's Blogs by xmurati and used with permission of the author. All other rights reserved by the author.

REST Introduction

APIs play an integral role in the development of modern-day applications. Whether you are writing your API or integrating someone else’s, it is crucial to understand their functioning. There are many APIs, but the most common types are REST APIs that operate using HTTP and HTTPS. I chose to write about REST APIs because we will be working with them in this class. They are essential to understand for most development projects. The blog post “Best practices for REST API design” discusses the basics of a REST API, how they work, and development practices. The post also provides code examples using NodeJS with the ExpressJS library showing how the concept of a REST API is implemented.

According to the article, a REST API follows a set of standard design principles that allow users to quickly be able to work with the API. For example, a REST API should include method endpoints such as /GET /POST /PUT and /DELETE. These endpoints are used to send and receive data between the server and the client. The difference between the endpoints is the operations they perform. Sending a request to a GET endpoint will send the client data, a POST request will add data, and a DELETE request will remove data.

Although there are a set of rules a REST API must follow, there are many best practices left up to the developer that they should follow. For example, a REST API should send and receive data in JSON. JSON makes working with data simpler because it is in an easily transferable and structured format. The API should also run over HTTPS rather than HTTP to add an extra level of security between communication.

A REST API closely resembles the structure of a URL where each method is separated by a forward slash. To pass a parameter, a question mark is used followed by the variable name equal to a value. In order to be readable, the developer must name and structure the API paths wisely, based on the function an endpoint is responsible for. For example, a GET request to find a user by ID could look something like /user/findOne?id=120. In this example, the findOne method is prefaced by /user/, and we know the user id we are finding is 120. If the API replaced the word user for record, then the developer using the API would not know what type of data to receive in the request.

Finally, a REST API should be versioned, meaning the highest level path of the URL structure should be the API’s version number. Using the find user example, a versioned API would read /v1/user/findOne?id=120. If we made a change to our API, we could modify that in the v2 API without breaking the code written using the v1 API.

I will definitely use these tips while developing a REST API in the future. One of the most important guidelines I learned was to always send and receive data in JSON. In the past, I have made a REST endpoint return a single value such as a number. Without any context, the data from the API would be hard to understand. If the values were named in JSON then it would be easier to work with and manipulate.


Reference blog resource: stackoverflow.blog/2020/03/02/best-practices-for-rest-api-design

From the blog CS@Worcester – Jared's Development Blog by Jared Moore and used with permission of the author. All other rights reserved by the author.

Just A Refresher For OOP Concepts

Hello and welcome back to my blog! I had a really fun time during the first few weeks of the semester and I am looking forward to the rest of it. The first POGIL group activity we did caught me off guard since I did not remember what the terms abstraction, encapsulation, polymorphism, and inheritance meant. These concepts were taught in one of the earlier programming classes and I have done school projects and labs that involved these concepts in the past. But I don’t actually remember the terms or the clear cut definitions of them. Maybe part of the reason why I did not remember them is because we briefly went over those topics and we were also not forced to remember them since those classes were more about if you could write the code correctly. So that is why I decided to focus my blog around those four concepts. The in-class activity was a good refresher but I wanted to do research to fully have a firm understanding of them. Having a strong understanding of these concepts will help me later on in my computer science journey since these concepts are going to be seen over and over again in object orientated programming.

Let’s start with abstraction. Abstraction is basically hiding unnecessary details and leaving only the necessary and relevant details. Hiding unnecessary information is useful because, well, it is not needed to show that information to the user. An example in real life is your smart phone. All that’s important to the user is the screen and they do not need to know what processor or how much RAM the phone has.

Encapsulation is bundling data with the code that modifies the data and it can also prevent outside sources from accessing that data. In Java, encapsulation is used in classes where data can be declared as private and outside methods cannot access that data.

Polymorphism is the ability to take on many forms. In Java, that means you can perform one tank many ways. An example of that is calculating the area of a shape. You can use the same method area() to calculate the area of a triangle, octagon, or any other shape. There’s also overriding methods where the child class has the same method as the parent class.

Inheritance is gaining the properties of one class to another class. It’s like a parent-child relationship. In Java, a child class inherits all the methods and attributes from its parent class. The vehicle example is a really good one. Vehicle would be the parent class and car and truck would be the child classes. Both car and truck would share the same attributes from vehicle but also have their own attributes as well.

This has been a good review for me and the website really helped me understand what the four OOP concepts are. In the future I hope to apply all of these concepts into my work.

Site used: https://www.nerd.vision/post/polymorphism-encapsulation-data-abstraction-and-inheritance-in-object-oriented-programming

 

From the blog Comfy Blog by and used with permission of the author. All other rights reserved by the author.

weekly blog (week one)

Hello, Everyone. How are you guys doing?

This past week, I read some articles or news related to CS (Computer Science). I finally picked a topic that caught my attention; engineers create 3D-printed objects that sense how users interact. My reason for why and seeing how choosing this article is because it looks cool and relatable for Gamers to use any controller made of small rubber pieces. 

 

Short Summary: The researchers found a way to combine sensing capabilities into 3D printable structures made of constant cells, enabling designers to prototype interactive input devices quickly. Even, Formed a new method to 3D print mechanisms that detect how force applies to an object. Or The structures are made from a single piece of material so that they can be rapidly prototypes. Also, A designer could use this method to 3D print “interactive input devices,” as a joystick or a controller.

For accomplishing the goal, the researchers blended electrodes into structures made from metamaterials (The materials split into a grid of duplicating cells). Also, They designed editing software that benefits users develop these interactive devices.

First, The researchers need embedded electrodes because a grid of cells creates the metamaterial. That benefits from the user implement strength to a metamaterial object; cells can spread or reduce with few adjustable interiors. They also take advantage by creating “conductive shear cells,” adjustable cells with two opposing walls made from the conductive wire and two walls made from the non-conductive thread. Even, The conductive walls operate as terminals.

When a user implements strength to the metamaterial mechanism, it running a joystick grip or pressing the buttons on a controller. The conductive shear cells expand or decrease. Even, The distance and overlaying area between the opposing terminals changes. While using capacitive sensing, those adjustments can be measured and used to calculate the magnitude and direction of the applied forces and rotation and acceleration.

For demonstration, the researchers built a metamaterial joystick with four conductive shear cells embedded around the base of the handle in each direction. Also, moving around the joystick handle, the distance and area between the opposing conductive walls change to sense each applied force’s direction and magnitude. By learning how joystick users use strength, a designer could test different handles from shapes and sizes for people with faulty grip strength in specific ways.

Second, The researchers created a sensitivity controller designed to adapt to a user’s hand. When the user holds one of the flexible buttons, conductive shear cells within the structure can diminish and send sense input to a digital synthesizer. Also, This method could allow a designer to instantly create and tweak differently adjustable input devices for a computer.

Lastly, MetaSense, the 3D editor the researchers improved, enables this fast prototyping for a software solution. The users can manually combine into a metamaterial device or let the software automatically place the conductive shear cells in optimal locations. The researchers attempted to make MetaSense straightforward, but there are tests for printing such intricate structures.

From the blog Andrew Lam’s little blog by and used with permission of the author. All other rights reserved by the author.

Self-Directed Professional Development Post #1

The episode I’m commenting on is titled, “#163 Layla Porter was led to coding by her horse riding and personal coaching business”.

I have a partner who is into horseback riding and so I selected this episode because I thought I could potentially develop something that helps her.

In the podcast episode I listened to, we follow the software developer, Layla Porter. Layla first started learning programming with ActionScript and HTML when she was young. Most of Layla’s early learning was self-taught and for personal entertainment.

Layla starts her story by talking about the opportunity she received as an adult to ride horses full time. This was something Layla was excited about because she grew up riding horses her whole life.

While riding horses full time, she had friends at her work, who knew how to code and would teach her object oriented programming, Objective C, and Model View ViewModel.

Eventually, Layla decided to take a break from horseback riding and became a speciality personal trainer for horseback riders. She started her own gym called, “The Rider’s Gym” and made her own website to set up her business. At first, she had a pretty successful gym for several years coaching both professional and amateur horseback riders.

After some time though, her business started to become less profitable and she started reading books and teaching herself the skills needed for a career switch to become a developer.

Layla applied to many jobs and eventually landed an entry level coding position. She managed to work her way up to a senior engineer after some additional job switches, and by dedicating herself to learning as much as she can in the field.

Currently, Layla still works in software development and she is an advocate for people from all backgrounds becoming developers if they are willing to put in the time and effort to learn it.

While my partner is not likely to start up her own fitness/horseback riding business soon, one of the most interesting things about this episode for me is how informal Layla’s learning experience was and yet she managed to become a successful developer.

As I continue in my own personal journey in software development, I’ve learned that though a formal education is invaluable, life experiences and projects that require me to develop/code are also critical.

Lastly, in this podcast episode, Layla referenced a couple of things that pertained to our course topics. She mentions how using a .Net framework was crucial for her creating her business website, she discusses how her friends taught her the principles of object oriented programming, and discusses how she focused on the front end of her website to make sure it was user friendly, while her partner worked on the backend to make sure her customers’ information was properly stored and managed.

Episode link: https://open.spotify.com/episode/7nG94EwjIH7UQPSc6ZD8H6

From the blog Sensinci's Blog by Sensinci's Blog and used with permission of the author. All other rights reserved by the author.

Polymorphism

This week, we reviewed about the concepts and the differences between the five terms, which were abstraction, interface, inheritance, encapsulation, and polymorphism. However, the term polymorphism confused me a lot during the class. The only thing that I remembered about polymorphism was that a class or an object could exist in many forms, but I could not explain to myself what “forms” mean. So, I did some searching on the term polymorphism in the hope that I could recall what I had learned and also learn more about the characteristics of polymorphism.

Fortunately, I found a good resource, called Polymorphism, Encapsulation, Data Abstraction, and Inheritance in Object Oriented Programming, written by Nick. Through this blog, Nick provides readers with concise definitions of abstraction, encapsulation, inheritance, and polymorphism with typical properties respect to each term. The writer also analyzes the important role of each concept in programming. Furthermore, after defining each term, Nick also has at least one example to describe the definition making the terms easier to understand for code newbies. This is one of the reasons that I chose this blog as my resource. In particular, in the polymorphism section, Nick gives an example of the class “Move” and the classes of animals to explain the phrase “exists in many forms”. The class “Move” does not have a concrete type, so it can be inherited/extended by any type of animal. For example, a Snail will crawl to move, a fish will swim to move, or a Kangaroo will leap to move. Hence, the concept of polymorphism is applied to make the code more flexible and extensible. This is a good blog to read and very useful if you want to understand clearly about the concepts of polymorphism, encapsulation, abstraction, and inheritance. I might forget these concepts if I don’t use them for a while. However, this blog gives me a key to remember those concepts in the long run by keeping in mind the real life examples provided by the blog.

Another thing is that after reading the blog, I know that there are several different types of polymorphism, but the writer does not analyze those types in depth in the blog. Therefore, I searched other sources to learn more about polymorphism. Different resources give me different numbers of polymorphism types. However, there is an article, called Polymorphism in Java, that gives me the necessary information about the types of polymorphism. There are many types of polymorphism, but in Java language, there are only two, which are compile-time polymorphism (overloading) and runtime polymorphism (overriding). Throughout the article, each type is described and analyzed using code examples. For myself, this is a good resource because although the article is short but concise, it contains all the information I need to know. Moreover, before reading the article, I had a chance to learn about the concepts of overloading and overriding, but I did not know how those two methods relate to the concept of polymorphism. So, the article not only helped me review my old knowledge, but also helped me to come up with the idea that I would organize all the concepts that I have learned into a diagram, where the diagram will show how concepts relate to each other. I believe the diagram will be one of my best tools that I can use to remember and distinguish all the important concepts in programming.

From the blog CS@Worcester – T's CSblog by tyahhhh and used with permission of the author. All other rights reserved by the author.

The Usefulness of UML

This week, we have started talking about UML (or Unified Modeling Language) in class, and while I can see some of the usefulness of UML, I wanted to see how people actually use it in the context of a workplace environment. So as a part of this, I found a blog post by Lucidchart talking about different types of UML diagrams. While this blog post is made by a company, and they are trying to get the reader to use their product, I don’t think detracts from the usefulness of the post.

So in this blog post they talk about how Agile developers can incorporate UML into their development process, as well as 7 different types of UML diagrams and how each one is useful, and which context it is useful for. It is largely just an overview of these different models, and I know there are more types of UML diagrams, but this gives a fairly good breakdown of what UML is and how it can be used in a more real-world context. I chose this post as I personally found it useful in understanding why anyone would actually want to use UML outside of a planning stage, since you are essentially planning out the whole class structure before you design it, so in my mind why wouldn’t you just write the code? Well this post makes the case that UML makes very good documentation for your code. If you have a class diagram, like the kind we worked with in class, you can use that as a sort of blueprint for your code. So you don’t have to scroll through hundreds of lines of code just to find all of the methods that are in it and how they interact with other classes, you can just look at the UML diagram. They also make the case that UML can be a valuable tool in explaining code to others.

From this blog post, I think I have a better understanding of how UML is (and should be) used in a workplace. There are a lot of different types of diagrams that were shown that I didn’t know were part of the point of UML, as I have only ever seen the class diagrams. But there are many models that fit under the purview of UML, each with different use cases. Some model runtime behavior in a way that it could be easily explained to someone who has no knowledge of programming, and some are able to show how different methods or classes communicate with one another, creating a diagram that can be easily looked at to make sure you aren’t going to mess with interactions in a system by making certain changes. I think that, given the proper context, UML could make a much more significant impact in understanding how we code, and has the ability to explain code to others in a way that even more traditional documentation methods lack.


Source: https://www.lucidchart.com/blog/types-of-UML-diagrams

From the blog CS@Worcester – Kurt Maiser's Coding Blog by kmaiser and used with permission of the author. All other rights reserved by the author.

Introduction

My name is Hung P Nguyen, I’m a senior at Worcester State University and majoring in Computer Science with both concentrations in Software Development and Big Data. The focus of this blog would be on the knowledge that I would gain while attending CS-343. Other than that, this blog would also be about me learning new techniques outside of the classroom and being able to adapt to technology. Personally, the most interesting thing that brings out my curiosity is Docker. As a necessity to many developers, Docker is playing such an essential role in their work-life which question me about its existence and practice

From the blog CS@Worcester – Nin by hpnguyen27 and used with permission of the author. All other rights reserved by the author.

JUnit 5

This week we had our first assignment. This assignment was about practicing writing JUnit 5 test cases. I am familiar with Junit 5 test cases from another computer class in last semester. Because I haven’t used Junit or coding in java for a while it took me a while to remember what I knew and how to code the test cases. JUnit 5 is most widely used testing framework for java applications. For very long time, JUnit has been doing its job perfectly. In between, JDK 8 brought very exciting features in java and most notably lambda expressions. JUnit 5 aims to adapt java 8 style of coding and several other features as well, that’s why java 8 is required to create and execute tests in JUnit 5.

In this homework, we had a BankAccount class and create at least one test class for the Bank Account System using Junit 5. In the base assignment we had to write the test for the methods that were in the BankAccount class and at the same time create a private method. In the intermediate we had to the write tests for which may include Custom Exceptions. In JUnit 5, to test methods which throws exceptions, we should use .assertThrows() method from org.junit.jupiter.api.Assertions class. The assertThrows() method asserts that execution of the supplied executable block or lambda expression which throws an exception of the expectedType.

In the advance I had to watch a podcast from Sam Brannen, Deep Dive into Junit5. The podcast was very interesting. From here I learned the fun fact that Junit5 is called Jupiter, the reason is Jupiter happens to be the fifth planet from the Sun. He explained some advantages and differences that Junit 5 has over 4 like; JUnit 5 has new features for describing, organizing, and executing tests, especially the display names and can be organized hierarchically, Junit 5 can use more than one extension at a time, you can easily combine the spring extensions with other extensions etc.

Overall, I really enjoyed working in this assignment even though I had to refresh my skills in java and writing test cases has always been a challenge for me but that doesn’t mean that I will give up.

https://howtodoinjava.com/junit5/junit-5-vs-junit-4/

From the blog CS@Worcester – Tech, Guaranteed by mshkurti and used with permission of the author. All other rights reserved by the author.