Category Archives: CS-343

Self-Directed Professional Development Post #4

For this week’s blog post, I’ve decided to watch a video titled, “Object Oriented Design Tutorial: Creating a UML Design from Scratch” by Derek Banas. The reason I picked this video is because 1. it directly relates to one of our course topics, “Modeling: Unified Modeling Language (UML)” and 2. because it teaches a methodical process to creating UML diagrams. This video is actually part of a series titled, “Object Oriented Design” and in the next video Derek shows how to create code from the UML design he’s created. Since I will likely be making more UML diagrams in my educational/professional life, I figured it would be good to further develop this skill.

One of the first things Derek mentions in this video is that he will be showing both the analysis and design stages for this process. The program that Derek is tasked to create for this video is a coin flipping program for two individuals. One player selects heads or tails, the other player gets assigned the other coin side, and the winner and loser is selected. Derek starts this process with something called a Use Case Description. For this description, Derek has a basic text editor open with the following categories: description, triggers, actors, preconditions, goals, not available, and steps of execution. Derek goes through each of these categories and writes in the relevant information for the program he needs to create:

  1. The description describes what happens in the program.
  2. Triggers mention how the program/game starts.
  3. Actors include the two players, the coin, and coin game.  
  4. Preconditions lists the things that need to be true for this program to run (i.e. 2 players are available, a coin is available).
  5. Goals list the outcome of the program (i.e. one player wins and the other loses).
  6. Not available references potential invalid inputs and extensions on how to make the program better in the future.
  7. Steps of execution describes what the program will do in a numbered list (each number represents a specific task).

Although this was only one part of the 30 minute tutorial, this was still an extremely useful process for me to observe Derek do. I learned how important it is to critically think about what you want your program to do before you jump into programming. I am definitely guilty of trying to jump into coding sometimes but I can see how cleaner and clearer code can be written by thinking and mapping things out in advance.

The thing I’m happiest about from this blog entry is finding this series and Derek’s YouTube channel. He has multiple tutorials on his channel that I can see myself learning a lot from. His videos are educational and thorough (many of them are 20-30 minutes long). As I continue growing as a programmer, I will definitely be referencing him to learn more useful information, techniques, and procedures.

Tutorial link: https://www.youtube.com/watch?v=fJW65Wo7IHI&list=PLGLfVvz_LVvS5P7khyR4xDp7T9lCk9PgE&index=3

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

UML Diagrams

Why do we need to know UML Diagrams?

UML diagrams can be used as a way to visualize a project before it takes place or as documentation for a project afterward. Seeing what you are doing and being able to measure where you are at in your project can help simplify the workloads and decrease the amount of stress that you may have. But the overall goal of UML diagrams is to allow teams to visualize how a project is or will be working.  

We have heard people say this word a lot: a picture is worth a thousand words. That’s why visualizing a process, especially during the development phase, is crucial for team communication and collaboration. The software development industry in the past has used dozens of ways to model and visualize development. 

We probably might ask what is exactly a UML? UML stands for Unified Modeling Language. It is a modeling language that is most often used for software engineering but has extended its use to business processes and other project workflows. Essentially, UML is visualizing software through diagrams. 

 Three software engineers at the company Rational Software for their projects have created this modeling language, and since it has become the standard with very few changes over the years. 

Software engineering and other business processes use UML diagrams to modeling their work which is a big part of today’s world.  

There are two main ways UML diagrams can be used:

  • Forward design. The modeling and design are all done before coding the software application. Usually, forward design is used to help developers better see the system they are trying to create. 
  • Backward design. The modeling is done after the code has been written, and the UML diagrams act as documentation for the workflow of the project. This can help developers see the project development as it was, in reality, to improve in the future.

Whether UML diagrams are used before or after the coding or project, they provide a way to visualize many aspects of a project and who is responsible for what activity.

I found that UML diagrams, help me to improve my coding skills. Being able to look at every aspect of my project design not only makes it easy but, also faster, especially when it comes to Object Oriented Programming. UML diagrams can be used as a way to visualize a project before it takes place or as documentation for a project afterward. 

From the blog CS@Worcester – Site Title by proctech21 and used with permission of the author. All other rights reserved by the author.

JavaScript and JavaScript Frameworks

Source: https://trio.dev/blog/javascript-framework

I chose to write about JavaScript frameworks this week, because they are so common in development today. And we will be covering Vue.js in this course. JavaScript is the most popular programming language. And it has been that way for many years. Web browsers can compile JavaScript natively so a user does not need to download a seperate piece of software to view the website. Because JavaScript is so ubiquitous, and building websites can be very time consuming, developers started to create JavaScript libraries and frameworks to make the process easier. Frameworks are so prevalent that using JavaScript without a framework is commonly referred to as “Vanilla” JavaScript.

I spend time every week looking at Software Engineer roles on linkedIn, and most companies want candidates to know JavaScript. Many companies mention React, Angular, or Vue. Some posts simply say JavaScript. But I suspect that some of these companies also use a JS framework, but the person that wrote the posting may not know the nuances of Software Development.

A JavaScipt framework contains pre-written JavaScipt code that is commonly used across many web applications. Some examples are creating a header, or accessing an API with HTTP methods and Axios. The terms JavaScript library and framework are at times used interchangeably. But there are some differences. A JavaScript library uses specific functions from parent code. But a framework defines the structure of an application using already written, reusable code. JavaScript frameworks have become popular because they save teams time, which saves money.

The JavaScript framwork I am most familiar with is Vue.js. I used Vue to create a dynamic web page for my internship. I am not very experienced with front end web development, and mostly worked independently. So this was quite challenging. But using a framework made things easier. with Vue I displayed JavaScript Objects or JSON data with V-for and V-if statements. Anybody that knows how to use for loops and conditionals could figure these out. But what is different about V-for is that I could conditionally render HTML elements. A good example would be if an array’s length is not zero, display the array. And with V-for you can dynamically diplay elements, from an array or an object in Key value pairs, just keys, or just values. Vue allowed me to display an HTTP in response in JSON format using V-if and V-for loops. This would not be possible using just HTML and CSS.

Companies are trying to find ways to create software and web applications faster. And JavaScript frameworks can help them achieve this. Personally, I am looking forward to learning more about JavaScript frameworks in the next two semetsers, and in my career.

From the blog CS@Worcester – Jim Spisto by jspisto and used with permission of the author. All other rights reserved by the author.

REST API, you keep hearing about it, but what is it?

Throughout my time in college, I like many others have heard plenty of different terms related to computer science. REST API was one of those terms. Now I was familiar with what an API was, but I did not know what the distinction is between that and REST. With a little research I was able to find out that the difference is that REST APIs are just normal APIs that follow the REST architectural style. REST stands for representational state transfer, which was developed by Dr. Roy Fielding in 2000 and provides six API design principals that should developers choose to follow would give them a relatively high level of freedom and flexibility. These six design principals are:

  • Uniform Interface:
    • This design principle ensures that all requests for the same resources need to look the same in order to ensure that data can only belong to one URI or Uniform Recourse Identifier
  • Client-Server decoupling
    • This design principal exists to ensure that the client apps and server apps remain independent of each other
  • Statelessness
    • Statelessness allows REST APIs to disregard the need to requests to be processed through an independent server session, and instead ensures that all requests contain all the information needed to process it
  • Cache-ability:
    • Cache-ability ensures that resources can be cached either on the client or server side. This is intended to help improve performance on the client side, while simultaneously improving scalability on the server side
  • Layered system architecture
    • The design of a REST API should make sure that the requests to the API go through multiple layers, in order to prevent the client and server from knowing whether they are communicating directly with an intermediary or the end application
  • Code on Demand
    • This is an optional step, and if the developer elects to include it it should allow the API to send back executable code in its responses, as opposed to the static responses that it usually send

Now all this may seem like a bunch of rules that need to be followed and it may not immediately be obvious as to the benefits that REST gives developers. I recommend you watch this video which goes into detail on what a REST API is and its benefits https: //www.youtube.com/watch?v=lsMQRaeKNDk; but in summary the main benefits are that it it simple to use and standardize, scalable, and they tend to be high performance. REST allows developers to not need to worry about the state of the data and how the requests need to be formatted for different situations. It eliminates some headaches that come with working with other non standardized APIs, allowing them to simply focus on getting the necessary information from the API and applying it to their application. I would also recommend you read this short article from IBM which includes the information found in this blog post, as well as more detail about the best practices with REST APIs as well as their use cases https://www.ibm.com/cloud/learn/rest-apis.

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

Interface

Abstraction is the most essential piece of object-oriented design. It allows the client peace of mind when it comes to the implementation details of functionality. In Java, abstraction is achieved through abstract classes and interfaces. This post will find the idea of the Interface Segregation Principle.

An Interface is a set of abstractions that an implementing class must follow. We define the behavior but don’t implement it:
in the example below, we will find how that is being written.
interface Car {
void break();
}
Using the interface as a template that actually can help us to implement the behavior:
class Toyota implements Car {
public void break(){
// Toyota-specific implementation
}
}
What Is the Interface Segregation Principle?
The Interface Segregation Principle (ISP) states that a client should not be exposed to methods it doesn’t need. Declaring methods in an interface that the client doesn’t need is problematic for several reasons.
Let’s look at an example to understand why the Interface Segregation Principle is helpful.
By creating these codes below you will be able to analyze how the methods are being called. Let’s formed an order service place where a customer can order an oil change, change tires, or basic tuneup:

interface OrderService {
void oilchange(int quantity);
void tirerotation(string front, string back);
void basictuneup(int quantity, string front, string back);
}

Since a customer has the opportunity to order an oil change, or tire rotation, or both, it will make sense to put all order methods in a single interface which be seen in the codes below.

class OilchangeOrderService implements OrderService {
@Override
public void oil-change(int quantity) {
System.out.println(“Received order of “+quantity+” oil change”);
}

@Override
public void ordertireroation(string front, string back) {
throw new UnsupportedOperationException(“No tirerotation in oil change only order”);
}

@Override
public void ordertuneup(int quantity, string tireration) {
throw new UnsupportedOperationException(“No tirerotation in oilchange only order”);
}
}
Similarly, for a tirerotation-only order, we’d also need to throw an exception in orderOilchange() method.
And this is not the only downside of this design. The OilchangeOrderService and TirerotationOrderService classes will also have unwanted side effects whenever we make changes to our abstraction.

This change will also affect oilchangeOrderService even though it’s not implementing this method!
By violating the ISP, we face the following problems in our code:
• Client developers are confused by the methods they don’t need.
• Maintenance becomes harder because of side effects: a change in an interface forces us to change classes that don’t implement the interface.

From the blog CS@Worcester – Site Title by proctech21 and used with permission of the author. All other rights reserved by the author.

Technical Debt

This weekend, I decided to research technical debt. I wanted to look further into this topic because one of my classes had activity introducing the term. I came across a wonderful blog discussing the different types of technical debt and how to manage them.

The blog: https://www.bmc.com/blogs/technical-debt-explained-the-complete-guide-to-understanding-and-dealing-with-technical-debt/#ref4

The blog lists four types of technical debt: planned technical debt, unintentional technical debt, unavoidable technical debt, and software entropy.

Planned technical debt: when a team has to compromise on the code but knows the risks and damages collecting the debt will have. An example is a team not spending time coding smaller aspects of a project in order to meet a deadline. The blog advises to keep a detailed record of the compromises to help the team keep track of what to address in the future.

Unintentional technical debt: arises from struggles with new coding techniques and problems from rollouts. An example of unintentional technical debt occurring is a design having many errors due to miscommunication between different teams working on a project.

Unavoidable technical debt: arises from changes in technology and business. A business may suddenly change its views on what features a project should have, and new technology may come out that can perform the functions more smoothly. This would make old code defunct.

Software entropy: occurs as software quality degrades. This can be caused by the changes developers (who do not fully understand the purpose of some code) make that yield more complex code. Overtime, the software will be riddled with errors and will be difficult to use.

The blog discusses three ways to manage technical debt, which are: assessing debt, communicating debt, and paying off debt.

Assessing debt: technical debt can be measured by how many days it would take developers to refactor or make changes to the target project, and the monetary value of that time can be calculated. This data could then be compared to upcoming significant events to help with cost analysis.

Communicating debt: it is important to properly convey the existence and impacts of technical debt to stakeholders so that fixes can be accounted for later.

Paying off debt: there are three ways to pay off technical debt: waive the requirement, refactor the application, or replace the application. Waiving the requirement would not set the team back in creating new features. Refactoring would help improve the structure of the code without changing program behavior. Replacing the application would result in new technical debt, but it should be limited and dealt with quickly.

This blog post taught me about technical debt in more depth, with the different types and different management aspects. I was curious on how technical debt could be calculated, but I’ve learned it can be measured by time spent to make the changes. Going forward, this information can help me understand what technical debt a project has and how to help deal with it. The graphics and the video the blog attached discussing debt was pleasant to view.

From the blog CS@Worcester – CS With Sarah by Sarah T and used with permission of the author. All other rights reserved by the author.

YAGNI.

Hello and welcome back to my blog! In this blog, I want to discuss YAGNI, which stands for “Ya ain’t gonna need it” or “You aren’t gonna need it.” My professor for CS-343 briefly mentioned it in class one day and I wanted to go over it more in depth. In the past, I’ve done something in my projects where I should have followed the concept of YAGNI instead. I made several methods to change a variable before I actually made the main methods of what that variable would do. In the end, it turns out the methods I made were useless toward my goal and I lost a lot of time. I hope to start applying the concept of YAGNI to my future programming in order to not waste time.

YAGNI is a really important concept in programming. Basically it means programmers and developers should only implement classes, methods, or whatever things they need only when they need them. By doing this, you can avoid doing unnecessary work and save a lot of time. When you think ahead and try to code a class or method that you think you will need in the future, it can be hard to know what exactly you need to include in it. The programmer has to do a lot of guessing and for a lot of the times, they guess incorrectly and end up not needing the feature that they spent some time on in the end. By following the concept of YAGNI instead, you don’t have to do all that guessing work and are also more focused on your current task. You should only develop things that you need once they become relevant. In a large project, YAGNI is especially beneficial for programmers and developers. Let’s say a programmer wants to design a feature they know they might need but aren’t sure if they need it or are unclear of how to implement it. By postponing the development of that feature, it can be more clear to the programmer/developer what they exactly need to do for that feature once it becomes relevant again. You should always ask yourself if the feature you are working on is really needed at the current moment. If it’s not needed, then you can take a note of it instead and come back to it later once it becomes relevant again. That way, you keep the project more simple and you program the features better since they are relevant and you have a more clear understanding of what to implement. And the most important thing, you save a lot of time with YAGNI.

 

Source: http://c2.com/xp/YouArentGonnaNeedIt.html

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

YAGNI.

Hello and welcome back to my blog! In this blog, I want to discuss YAGNI, which stands for “Ya ain’t gonna need it” or “You aren’t gonna need it.” My professor for CS-343 briefly mentioned it in class one day and I wanted to go over it more in depth. In the past, I’ve done something in my projects where I should have followed the concept of YAGNI instead. I made several methods to change a variable before I actually made the main methods of what that variable would do. In the end, it turns out the methods I made were useless toward my goal and I lost a lot of time. I hope to start applying the concept of YAGNI to my future programming in order to not waste time.

YAGNI is a really important concept in programming. Basically it means programmers and developers should only implement classes, methods, or whatever things they need only when they need them. By doing this, you can avoid doing unnecessary work and save a lot of time. When you think ahead and try to code a class or method that you think you will need in the future, it can be hard to know what exactly you need to include in it. The programmer has to do a lot of guessing and for a lot of the times, they guess incorrectly and end up not needing the feature that they spent some time on in the end. By following the concept of YAGNI instead, you don’t have to do all that guessing work and are also more focused on your current task. You should only develop things that you need once they become relevant. In a large project, YAGNI is especially beneficial for programmers and developers. Let’s say a programmer wants to design a feature they know they might need but aren’t sure if they need it or are unclear of how to implement it. By postponing the development of that feature, it can be more clear to the programmer/developer what they exactly need to do for that feature once it becomes relevant again. You should always ask yourself if the feature you are working on is really needed at the current moment. If it’s not needed, then you can take a note of it instead and come back to it later once it becomes relevant again. That way, you keep the project more simple and you program the features better since they are relevant and you have a more clear understanding of what to implement. And the most important thing, you save a lot of time with YAGNI.

 

Source: http://c2.com/xp/YouArentGonnaNeedIt.html

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

YAGNI.

Hello and welcome back to my blog! In this blog, I want to discuss YAGNI, which stands for “Ya ain’t gonna need it” or “You aren’t gonna need it.” My professor for CS-343 briefly mentioned it in class one day and I wanted to go over it more in depth. In the past, I’ve done something in my projects where I should have followed the concept of YAGNI instead. I made several methods to change a variable before I actually made the main methods of what that variable would do. In the end, it turns out the methods I made were useless toward my goal and I lost a lot of time. I hope to start applying the concept of YAGNI to my future programming in order to not waste time.

YAGNI is a really important concept in programming. Basically it means programmers and developers should only implement classes, methods, or whatever things they need only when they need them. By doing this, you can avoid doing unnecessary work and save a lot of time. When you think ahead and try to code a class or method that you think you will need in the future, it can be hard to know what exactly you need to include in it. The programmer has to do a lot of guessing and for a lot of the times, they guess incorrectly and end up not needing the feature that they spent some time on in the end. By following the concept of YAGNI instead, you don’t have to do all that guessing work and are also more focused on your current task. You should only develop things that you need once they become relevant. In a large project, YAGNI is especially beneficial for programmers and developers. Let’s say a programmer wants to design a feature they know they might need but aren’t sure if they need it or are unclear of how to implement it. By postponing the development of that feature, it can be more clear to the programmer/developer what they exactly need to do for that feature once it becomes relevant again. You should always ask yourself if the feature you are working on is really needed at the current moment. If it’s not needed, then you can take a note of it instead and come back to it later once it becomes relevant again. That way, you keep the project more simple and you program the features better since they are relevant and you have a more clear understanding of what to implement. And the most important thing, you save a lot of time with YAGNI.

 

Source: http://c2.com/xp/YouArentGonnaNeedIt.html

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

YAGNI.

Hello and welcome back to my blog! In this blog, I want to discuss YAGNI, which stands for “Ya ain’t gonna need it” or “You aren’t gonna need it.” My professor for CS-343 briefly mentioned it in class one day and I wanted to go over it more in depth. In the past, I’ve done something in my projects where I should have followed the concept of YAGNI instead. I made several methods to change a variable before I actually made the main methods of what that variable would do. In the end, it turns out the methods I made were useless toward my goal and I lost a lot of time. I hope to start applying the concept of YAGNI to my future programming in order to not waste time.

YAGNI is a really important concept in programming. Basically it means programmers and developers should only implement classes, methods, or whatever things they need only when they need them. By doing this, you can avoid doing unnecessary work and save a lot of time. When you think ahead and try to code a class or method that you think you will need in the future, it can be hard to know what exactly you need to include in it. The programmer has to do a lot of guessing and for a lot of the times, they guess incorrectly and end up not needing the feature that they spent some time on in the end. By following the concept of YAGNI instead, you don’t have to do all that guessing work and are also more focused on your current task. You should only develop things that you need once they become relevant. In a large project, YAGNI is especially beneficial for programmers and developers. Let’s say a programmer wants to design a feature they know they might need but aren’t sure if they need it or are unclear of how to implement it. By postponing the development of that feature, it can be more clear to the programmer/developer what they exactly need to do for that feature once it becomes relevant again. You should always ask yourself if the feature you are working on is really needed at the current moment. If it’s not needed, then you can take a note of it instead and come back to it later once it becomes relevant again. That way, you keep the project more simple and you program the features better since they are relevant and you have a more clear understanding of what to implement. And the most important thing, you save a lot of time with YAGNI.

 

Source: http://c2.com/xp/YouArentGonnaNeedIt.html

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