Category Archives: CS-343

Monoliths and Microservices

Students often focus on code with a singular program as the goal. However, there are many different software architectures to consider based on the scope and specifications of a software. The article linked below gave a detailed comparison of two major architectures types: monolithic and microservices. A monolithic architecture is like the all-in-one software solution. […]

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

UML Diagrams

Unified Modeling Language (UML) is an important tool in software development that helps developers visualize, design, and document the structure of their systems. It allows developers, project managers, and stakeholders to communicate with a medium that is easier to digest and explain. This week, I found a blog that introduces UML diagrams, “What is a UML Diagram?” from Miro. Miro gives an in-depth view of the types, benefits, and when to use UML diagrams.

Early in our course, we discussed and modeled Sequence and Class Diagrams. I chose this resource because of that foundation and because it is a great starting point for beginners. It also explained more diagram types than presented in class.

The blog explains that UML is a standardized modeling language used to visually represent a system’s design in a understandable way. It highlights two main types of diagrams, each with their own subtypes.

  1. Structural Diagrams: These visualize the components in the system and their relationships. Some examples include:
    • Class Diagram: The static structure of a system showing classes, attributes, and relationships.
    • Package Diagram: Shows how packages and their dependencies are organized within the system
    • Deployment Diagram: Shows how software and hardware interact
  2. Behavioral Diagrams: These visualize the system’s behavior over time. It is the dynamic behavior of the system. Some examples include:
    • Activity Diagram: Visualized the flow of activities within a system.
    • Sequence Diagram: Shows how objects interact over time.
    • Use Case Diagram: Shows the functionality of the system from the user’s perspective.

The post then describes the benefits of UML diagrams, such as simplifying complex ideas/code and improving team collaboration. It finishes by explaining the best practices and when to use UML diagrams.

This post helped me shore up my lacking knowledge of UML diagram types. I was unaware of most diagram types discussed, so it was nice to see what they were and how they were properly used. The site also provided a link to a diagram maker with some of the types which could be useful in the future.

The benefits were also insightful. The main takeaway was that the UML diagrams keep everyone on the same page. From the technically inclined to those lacking knowledge, you can communicate the system’s functions effectively. This seems especially true for those working in teams with different specialties. Having a roadmap for the system’s functions with a standard notation that everyone can understand allows the team to work more efficiently. In the future, I will use UML diagrams to keep everyone involved in our projects on the same page so we can collaborate to make our software more effective.

Resource: https://miro.com/diagramming/what-is-a-uml-diagram/#1.-simplifies-complex-ideas-and-systems

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

SemVer or CalVer: When to Use

Understanding Versioning: SemVer vs. CalVer Most software, libraries, games, etc… will come with a version number attached. Often times, it is easy to just gloss over this and not pay much attention, however that number can reveal important information. The article linked below compares 2 types of versioning you may encounter. Semantic Versioning (SemVer) – […]

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

Backend Development

Backend development is the backbone of any software application. It handles the functionality behind the scenes, supporting interactions between the users and the application or website. The backend manages databases and server-side logic so modern applications remain efficient, scalable, and reliable. Understanding the principles of backend development is essential for developers to create effective software.

For this week’s post, I found a resource discussing key elements of backend development called “Mastering Backend Development” by Dan for Roadmap.sh. Dan introduces a roadmap for becoming an effective backend developer, and in this post, he discusses some of the steps on this roadmap in detail.

Backend development has been a key component of our class. I chose this resource because it is connected to the course, and the roadmap seems accessible to new developers. Having a path for your research and actionable steps to take can help with any knowledge gaps or roadblocks in understanding backend development.

This resource outlines 19 important steps or knowledge necessary for backend development. I have limited the summary to those I found interesting or instructive.

Caching Strategies: Improving the performance by storing copies of frequently requested data, reducing database load, and speeding up responses.

Authentication and Authorization: Ensures only authorized users access the system by implementing security measures.

Architectural Patterns: Picking the correct pattern, like Monolithic or Microservices, helps build scalable and maintainable systems.

Observability and Monitoring: Provide tools to monitor the system’s health, optimize performance, and diagnose issues.

Continuous Learning: Staying up-to-date with technologies, frameworks, and best practices. This ensures developers can adapt to the rapid evolution of backend development.

Some steps seem self-explanatory, but they could provide a good foundation for someone new to backend development. I could see how new developers could choose to prioritize the software’s functionality while forgetting its efficiency, security, and diagnostics. The post also offered plenty of tools to help with each step, like Redis and Memcached for caching strategies and OAuth and JWT for authentication and authorization.

I felt Dan gave an excellent synopsis of the research needed for new developers. Plenty of steps were not readily apparent to me, like cashing or your system’s self-diagnostics. These steps will likely present themselves in development, but for someone with little experience, it gives a good direction for research. This mindset aligns with the last step, continuous learning, and the importance of staying proactive regarding new challenges and technologies. In the future, I will research these backend concepts and stay up to date so I can produce and maintain better backend software.

Resource: https://dev.to/roadmapsh/mastering-backend-development-mpb

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

Refactoring Tech Debt

While studying for my most recent exam in CS-343, I came across a phrase I was familiar with but did not know the meaning of: technical debt. I had a vague understanding and understood refactoring’s purpose to repay technical debt, but I was not positive. I came across an article on increment.com talking about refactoring the definition of technical debt into technical wealth. This article’s title is Reframing Tech Debt by Leemay Nassery

The article discusses the concept of tech debt, which is the accumulation of negative choices made during product development that can hinder long-term system efficiency. The article proposes reframing it as tech wealth. The article begins by explaining that tech debt arises from quick fixes and shortcuts taken to meet product goals. This debt leads to system inefficiencies that accumulate over time. Tech wealth reframes this idea as an investment in building scalable systems that improve developer productivity, system stability, and overall team happiness. A key example comes in the form of an automated deployment system, which makes all development afterwards faster. Tech debt is often seen as a nuisance or a negative aspect of engineering, but through tech wealth you allocate time to improve the code’s architecture. The article argues that addressing tech debt (or building tech wealth) should be prioritized, as it ultimately saves time and resources in the long term. The article gives some example strategies to build tech wealth:
1. Allocate Time in Planning Cycles: Teams should allocate a portion of their engineering capacity to work on tech wealth alongside feature development. For example, 20% of the time can be dedicated to tech wealth activities such as automating processes or improving system architecture.
2. Quarterly Focus: Teams can also dedicate a few cycles per quarter to focus entirely on tech wealth, using this time to clean up past code and improve the system’s foundation.

The article closes with a conclusion that suggests rethinking tech debt as tech wealth and incorporating this mindset into planning cycles. This shift not only benefits engineers but also leads to improved product outcomes for users, even if the benefits aren’t always immediately visible.

This article was essential in my complete understanding of the importance of technical debt. Through this article I was able to conclude strategies to tackle technical debt, and the power to be found in conquering it. I found the automated deployment example most tangible as I have had struggles developing in environments without that feature. Tackling these issues is an interest of mine and I am excited to read more.

https://increment.com/planning/reframing-tech-debt/

From the blog CS@Worcester – WSU CS Blog: Ben Gelineau by Ben Gelineau and used with permission of the author. All other rights reserved by the author.

plantuml and markdown – tools learned too late

Every computer science student has taken a course that requires them to make charts, diagrams, graphs and other visual tools. One of the biggest tools I wish I knew about early on is plantuml in markdown files.

Unified modeling language, the UML portion of plantuml is as a visual modeling language. To be more specific, plantuml is just a good open-source tool that incorporates uml and other things like support for visualization of JSON and YAML files.

Markdown (a .md file) is a language that lets you format text and symbols. 

The combination of these languages would have made many of the courses in my past much easier. I could also see it being useful in the future when it comes to modeling any work. VScode only requires a couple extensions to get it to work .

There are a few different sources one could go to, to figure out how to write the code that they need for whatever task is at hand. Those resources will be listed at the end.

For now there will be a couple basic examples showing how the diagrams from the previous blogs are made.

This is the diagram from the previous blog:

For this breakdown we will be keeping it simpler and using a smaller portion of this diagram.

The diagram we will be looking at:

Oh how nice it would have been if I could use this to organize group projects early on in my academic career. 

the code to make it present this way looks like this:

With the plantuml extensions you simply put 3 back quotes (“`) and plantuml. Then go to town following whatever cheat sheet you like to use to help you write the code. You can show relations, display classes and even put notes for more details.

This example keeps it fairly simple, it can get a little more complex depending on the size of your diagram and what you are doing. 

Like was mentioned earlier you can even make diagrams for relational databases!

ex.)

The amount of time me and my friendsin class had spent using different cookie cutter diagram makers in our browser that would hide features we needed behind paywalls…

Even if you’re just making a list of tasks you need to do or formatting a paper markdown by itself has a lot of useful tools. One of my personal favorites is crossing off a list using the tilde key (~).

ex.)

Markdown and plantuml are on the same list as unit testing when it comes to things I wish were taught before getting deep into programming courses. 

Do yourself a big favor and get at least a little familiar with it.

Cheat sheets:

Plantuml simple – https://ogom.github.io/draw_uml/plantuml/

Plantuml official – https://pdf.plantuml.net/PlantUML_Language_Reference_Guide_en.pdf

Markdown simple – https://github.com/adam-p/markdown-here/wiki/markdown-cheatsheet

Markdown official – https://www.markdownguide.org/cheat-sheet/

Sources: 

Database example – https://medium.com/@elvis.gosselin/plantuml-for-database-modeling-1b71e6d4622d

From the blog Mikes CS 343 by Michael St. Germain and used with permission of the author. All other rights reserved by the author.

RESTful API: Tips and Tricks

REST stands for Representational State Transfer and API is application programing interface. Simply put, when there are multiple systems working together, a RESTful API allows a person to query or edit information in the system. I recently read a javaguides post on how to set up properly scalable API’s and wanted to share a short summary.

Tip 1: Domain Model-Driven Design
This means you should have the structure mirror the real-life pieces. So if, for example, you want the items of an order, the endpoint should look like “/orders/{id}/items”. Also, don’t nest it too deep, it will add needless complexity.

Tip 2: Choose HTTP methods appropriately
The 4 main methods and their use cases are; GET for getting data, POST for posting a new object to the database, PUT for putting a new object in place of an existing object, DELETE for deleting objects in the database. There is also PATCH which can be used patch an existing object. If you are using GET to modify an object you are adding unnecessary complexity. I personally will be adapting my use case of PUT after understanding the difference with PATCH

Tip 3: Implement Impotence Properly
A method is idempotent if no matter how many times it is called after the first, there is no behavior change from the first call. If you call DELETE multiple times on the same object then only that object should be deleted. GET is already idempotent, it will always get the object’s data regardless of whether you already called GET. PUT and PATCH should be implemented similarly to DELETE. The hiccup is with POST, because simultaneous calls are possible (two people can create new objects with the same identifier) logic to handle these calls needs to be made.

Tip 4: Chose the correct HTTP status calls
When a call is made, there are codes for the result. They are; 200 for a valid request, 201 for an object being created, 400 for an incorrectly formatted request, 401 if requester is unauthorized, 403 for a forbidden request, 404 if the object request is not found, and 500 for a server-side error. I am going to research more about how the permissions are set up when someone makes request and the logic behind blocking certain requests.

Tip 5: Versioning
Include which version of the API the request is using, maybe put it in the path “/v1/users”. They also list alternatives such as having a query parameter “/users?=v1” or adding a HEADER to the request that includes the version number. I never thought about adding versioning to the request but it makes sense to allow for previous versions to still request.

Tip 6: Use Semantic Paths
Singular resources use singular nouns and the path should be using the resources.
DON’T: POST /v1/loginUser
DO: POST /v1/users/login

Tip 7: Support Batch Processing
Something like:
POST /v1/users/batch
to allow for multiple users to be made in one POST.

Tip 8: Use query parameters for flexibility
You can add the ability to sort the data requested, or filter it, using queries. So:
/v1/users?age=gt:20
and
/v1/users?sort=name:asc
This is some awesome functionality and I cannot wait to implement it in my own system.

Link:
https://www.javaguides.net/2024/12/top-8-tips-for-restful-api-design.html

From the blog CS@Worcester – Coder's First Steps by amoulton2 and used with permission of the author. All other rights reserved by the author.

Mastering Backend Development: A Comprehensive Guide

Backend development is where the real magic happens. While users interact with the front end of an application, the backend is responsible for everything from data storage to user authentication, ensuring smooth communication between services. Mastering backend development goes beyond learning a single language or framework it’s about understanding how to build scalable, secure, and maintainable systems. In this overview, Im going to talk about the article written by DEV COMMUNITY on mastering backend development

Choosing the Right Language

Choosing the right language is the first step in backend development. Your choice depends on the project’s requirements and your long-term goals. JavaScript (Node.js) is popular for event-driven servers, while Python is great for data-centric applications. Java is ideal for enterprise solutions, and Go is well-suited for high-performance services. Each language has its strengths, so pick one that aligns with your project needs.

Understanding HTTP and Networking

Since backend services communicate over the internet, understanding HTTP is crucial. Knowing how HTTP methods like GET, POST, PUT, and DELETE work, along with concepts such as DNS, will help you design efficient and secure APIs. A solid understanding of these concepts allows smooth communication between services and ensures reliable system integration.

Working with Databases

Databases are fundamental to backend development. Whether you’re using relational databases like PostgreSQL or NoSQL databases like MongoDB, it’s essential to know when to use each. A solid understanding of database management enables you to store and retrieve data efficiently, which is crucial for building fast and scalable systems.

API Design and Development

APIs are the backbone of communication between system components. Designing an efficient and secure API is key to building scalable systems. Whether you’re using REST, GraphQL, or gRPC, consider factors like versioning, security, and documentation to make integration easy for other developers.

Security Practices

Security is essential in backend development. Implementing robust authentication methods like OAuth and JWT ensures that only authorized users can access your services. Understanding common security threats and mitigation strategies is key to protecting your system from unauthorized access and data breaches.

Caching and Performance

To optimize performance, caching is a must. Using tools like Redis or Memcached can help reduce database load and speed up response times by temporarily storing frequently accessed data. Proper caching strategies can drastically improve your system’s performance and scalability.

Scalability and Load Balancing

As your application grows, scaling becomes crucial. Load balancing tools like Nginx or HAProxy ensure that traffic is evenly distributed across servers, helping handle increased traffic without sacrificing performance. Understanding scaling strategies, such as horizontal and vertical scaling, is essential for building resilient systems.

Continuous Learning

Backend development is always evolving. Keep up with new tools, frameworks, and best practices by reading blogs, contributing to open-source projects, and experimenting with new technologies. Continuous learning is essential to becoming a skilled backend developer.

By mastering these concepts, you’ll be on your way to building robust, scalable, and secure backend systems.

Reference
https://dev.to/roadmapsh/mastering-backend-development-mpb

From the blog CS@Worcester – The Bits & Bytes Universe by skarkonan and used with permission of the author. All other rights reserved by the author.

Essential Software Architecture Design Patterns

This week, I am focusing on the blog “The Software Architect: Demystifying 18 Software Architecture Patterns.” by Amit Verma. Verma is an architect who focuses on creating Java applications among other work. This blog aligns with our course work as we focus on software architecture and we have recently learned the details related to some of the design patterns mentioned here. This post has introduced me to new architecture design patterns to study and provided a vast array of knowledge like when to apply them and how to properly use them in my future projects.

Verma begins by specifying what software architecture is and how it differs from software design. I appreciate how this was explained because it makes the concepts simple to understand. Software architecture focuses on the high-level structure like the blueprint of the project, software design focuses on translating this blueprint into real project specifications which developers can implement. A concept in this post that was new to me was the architecture documentation approach, the C4 model. This model ensures that there is a structure that is able to be implemented by addressing four main levels: context, containers, components, and code. The C4 model encourages architects to create diagrams and written documents to ensure comprehensive project documentation.

The beauty of architectural patterns lies in their repeatability; they provide reusable solutions that address common goals and challenges across projects, enabling architects to achieve a specific, predetermined outcome efficiently. This post provides information related to 18 different architecture patterns that are commonly used and necessary for software developers to be familiar with. Some of the patterns were entirely new to me like the Layered Pattern, Pipe-filter Pattern, and the Microkernel Pattern. Beginning with the Layered Pattern, this architecture separates different functionalities into different layers. One common representation of this uses three main layers, the presentation layer which responsible for the UI and other user-focused components, the business logic layer which focuses on the business rules and the actual code to manage data and make calculations, and the data access layer which is handles database/external data source interactions. Next, the Pipe-filter Pattern uses independent components to process data using separate processing tasks. Beginning with the data source, moving into the pipe which connects components, then using filters to transform the data based on a given function, and finally the data sink or endpoint which receives the processed data output. Lastly, the Microkernel Pattern a.k.a. Pluggable Architecture allows for modular, flexible systems to be built. In this architecture, the system’s core services are handled in the microkernel and all other components are separated known as a plug-and-play concept.

This post is rich with vital information related to software architectures and provides knowledge far beyond what I have included here. I know I will be returning to this blog repeatedly as a resource to learn from and to use a basis of how these patterns can be implemented.

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

REST API Designs

Week-15: 12/20/2024

This blog post really helped me understand how important design patterns are for making REST APIs that are easy to use and can handle a lot of traffic. The post talked about things like naming resources consistently, breaking up big chunks of data into smaller pieces, and making sure that updates don’t break older versions of the API.

One thing that really stuck with me was how important it is to name your resources consistently. The post emphasized that using standard and intuitive naming conventions makes APIs predictable for other developers. It’s like having a well-organized filing system—if everyone knows where things are supposed to go, it’s much easier to find what you need.

The post also talked about things like versioning and error handling, which are super important for making sure that your API can evolve over time without breaking things for people who are already using it. Versioning ensures backward compatibility as APIs evolve, which means that even if you make changes to your API, older applications that use it will still continue to work. Error handling is all about giving developers useful information when something goes wrong. The post mentioned that providing informative error responses can help guide developers who are using your API. I’m definitely going to be focusing more on these aspects in my future projects.

The reason that I chose this blog post was because it aligns closely with what I learned in the class. Our class discussions often emphasized the best practices for creating maintainable, user-friendly APIs, and this post serves as a practical extension of those theoretical concepts. I wish I had read this article before some of my homework assignments; it would have made it easier for me to understand the assignments. Additionally, its concise, actionable guidance provides a clear framework for applying these principles in real-world scenarios.

Overall, this blog post was a great way to connect the theoretical stuff we’ve been learning in class with how things actually work in the real world. It’s one thing to understand these concepts in theory, but it’s another thing to see how they’re applied in practice. This blog post provides practical insights into designing APIs that are easy to use and can be scaled up as needed. It’s given me a much better understanding of how to create APIs that are not just functional but also developer-friendly and built to last.

Blog link: https://blog.stoplight.io/api-design-patterns-for-rest-web-services

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