Monthly Archives: November 2021

Software Framework

A framework is similar to an application programming interface (API), though technically a framework includes an API. As the name suggests, a framework serves as a foundation for programming, while an API provides access to the elements supported by the framework. Also, a framework may include code libraries, a compiler, and other programs used in the software development process. There are two types of frameworks which are: Front end and back end.

The front end is “client-side” programming while a back end is referred to as “server-side” programming. The front-end is that part of the application that interacts with the users. It is surrounded by dropdown menus and sliders, is a combo of HTML, CSS, and JavaScript being controlled by our computer’s browser. The back-end framework is all about the functioning that happens in the back end and reflects on a website. It can be when a user logs into our account or purchasing from an online store.

Why do we need a software development framework?

Software development frameworks provide tools and libraries to software developers for building and managing web applications faster and easier. All the frameworks mostly have one goal in common that is to facilitate easy and fast development.

Let’s see why these frameworks are needed:

  1. Frameworks help application programs to get developed in a consistent, efficient and accurate manner by a small team of developers.
  2. An active and popular framework provides developers robust tools, large community, and rich resources to leverage during development.
  3. The flexible and scalable frameworks help to meet the time constraints and complexity of the software project.

Here are some of the importance of the framework. Now let’s see what are the advantages of using a software framework:

  1. Secure code
  2. Duplicate and redundant code be avoided
  3. Helps consistent
  4. developing code with fewer bugs
  5. Makes it easier to work on sophisticated technologies
  6. Applications are reliable as several code segments and functionalities are pre-built and pre-tested.
  7. Testing and debugging the code is easier and can be done even by developers who do not own the code.
  8. The time required to develop an application is less.

I chose this topic because I have heard many times about software frameworks and was intrigued by learning more about them, what they are, how they work, and what their importance is in the software development field. Frameworks or programming languages are important because we need them to create and develop applications.

Software Development Frameworks For Your Next Product Idea (classicinformatics.com)

Framework Definition (techterms.com)

From the blog CS@Worcester – Software Intellect by rkitenge91 and used with permission of the author. All other rights reserved by the author.

Blog Post 5 – SOLID Principles

When developing software, creating understandable, readable, and testable code is not just a nice thing to do, but it is a necessity. This is because having clean code that could be reviewed and worked on by other developers is an essential part of the development process. When it comes to object oriented programming languages, there are a few design principles that help you avoid design smells and messy code. These principles are known as the SOLID principles. These principles were originally introduced by Robert J. Martin back in 2000. SOLID is an acronym for five object oriented design principles. These principles are:

  1. Single Responsibility Principle – A class should have one and only one reason to change, meaning that a class should have only one job. This principle helps keep code consistent and it makes version control easier.
  2. Open Closed Principle – Objects or entities should be open for extension but closed for modification. This means that we should only add new functionality to the code, but not modify existing code. This is usually done through abstraction. This principle helps avoid creating bugs in the code.
  3. Liskov Substitution Principle – Let q(x) be a property provable about objects of x of type T. Then q(y) should be provable for objects y of type S where S is a subtype of T. This means that subclasses can substitute their base class. This is expected because subclasses should inherit everything from their parent class. They just extend the parent class, they never narrow it down. This principle also helps us avoid bugs.
  4. Interface Segregation Principle – A client should never be forced to implement an interface that it doesn’t use, or clients shouldn’t be forced to depend on methods they do not use. This principle helps keeps the code flexible and extendable.
  5. Dependency Inversion Principle – Entities must depend on abstractions, not on concretions. It states that the high-level module must not depend on the low-level module, but they should depend on abstractions. This means that dependencies should be reorganized to depend on abstract classes rather than concrete classes. Doing so would help keep our class open for extension. This principle helps us stay organized as well as help implement the Open Closed Principle.

These design principles act as a framework that helps developers write cleaner, more legible code that allows for easier maintenance and easier collaboration. The SOLID principles should always be followed because they are best practices, and they help developers avoid design smells in their code, which will in turn help avoid technical debt.

https://www.digitalocean.com/community/conceptual_articles/s-o-l-i-d-the-first-five-principles-of-object-oriented-design#single-responsibility-principle

https://www.freecodecamp.org/news/solid-principles-explained-in-plain-english/

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

Best Docker Tutorial IMHO

While in the process of trying to learn Docker as part of my Software Architecture class, I watched 5 YouTube videos. YouTube has been a real benefit to me for learning college level science courses. I have had good luck with Biology, Organic Chemistry, and even Statistics tutorials, but have not had much luck so far with Computer Science videos. There are some good ones out there, though, and “Docker Tutorial for Beginners – A full DevOps course on how to run applications in containers [1] is certainly one the best I have seen.

This 2-hour course by Mumshad Mannambeth covers all the bases in a clear and interesting manner and is enhanced with well thought out structure and graphics. The lectures are accompanied by direct access to a full-fledged Docker environment through labs [2] on a website

The course is broken up into sections exploring the definitions of containers, images, Docker itself, why you need it, and what you can do with it. He then goes on to explain the basic commands needed to create a docker image, how to build and run it in a container, the basic concepts of Docker Compose, YAML, and DockerFile.

He leaves the technical details of installing Docker Desktop for Windows and the MAC until later in the video, giving more time up front to clearly describe why you want to use it, what it accomplishes for the software development community, and how containerization is the future of enterprise level software. These installation sections are also well done but are not relevant for those who already have docker installed, or for those without the time to build their own environments. The tutorial and accompanying interactive quizzes on the right side of the site, are resources I will come back to in the future, because of their depth and clarity.

He then allocates about 40 minutes going into docker concepts and commands in depth and follows up with a history and description of the importance of continuous integration using container orchestration tools like Swarm and Kubernetes. He clearly lays out the architecture of a system that is complex, distributed, fault-tolerant, and easy to implement. He details the importance of DevOps, where the design, development, testing, and operations teams are seamlessly connected and have a symbiotic relationship. This makes everyone’s jobs easier, cuts down on departmental finger pointing when things go wrong, and brings product to market much quicker and with less bugs shipped.

He also covers the following areas:

1. Layered architecture

2. Docker registry

3. Controlling volumes

4. Port forwarding

5. Viewing logs

6. The advantages of container architectures over Virtual Machines and Hypervisors.

7. KubeCtrl

I was pleasantly surprised to have found this. Maybe I should give the computer science YouTube community more credit.

References:

[1]  YouTube link:

[2]  Tutorial links:

 www.freecodecamp.org

 www.kodecloud.com

Exhibits:

(1) Why do you need Docker?

(2) Container orchestration tools

(3) Layered architecture

(4) Hand-on Lab

From the blog cs@worcester – (Twinstar Blogland) by Joe Barry and used with permission of the author. All other rights reserved by the author.

Artificial Intelligence and its future

Artificial intelligence (AI) is intelligence demonstrated by machines, as opposed to natural intelligence displayed by animals including humans. Leading AI textbooks define the field as the study of “intelligent agents”: any system that perceives its environment and takes actions that maximize its chance of achieving its goals, Some popular accounts use the term “artificial intelligence” to describe machines that mimic “cognitive” functions that humans associate with the human mind, such as “learning” and “problem solving”, however, this definition is rejected by major AI researchers.

AI in healthcare:

AI in healthcare has gained significant traction during the pandemic. AI has taken on a much bigger role in healthcare during the pandemic. The White House partnered with AI research institutions to mine scientific literature to better understand Covid-19. Biotech companies and big tech players leveraged AI to understand the structure of the novel coronavirus to expedite drug discovery. Social distancing and lockdown measures forced medical labs to accelerate their digital pathology capabilities.   Amid economic uncertainties, healthcare AI companies raised recording funding in Q3’20.

AI will change healthcare by 2030:

This article is part of the World Economic Forum Annual Meeting. By 2030, AI will access multiple sources of data to reveal patterns in disease and aid treatment and care. Healthcare systems will be able to predict an individual’s risk of certain diseases and suggest preventive measures. AI will help reduce waiting times for patients and improve efficiency in hospitals and health systems. The first big consequence of this in 2030 is that health systems are able to deliver truly proactive, predictive healthcare.

AI and the Future of Work:

A recent study from Redwood Software and Sapio Research underscores this view. Participants in the 2017 study said they believe that 60 percent of businesses can be automated in the next five years. On the other hand, Gartner predicts that by 2020 AI will produce more jobs than it displaces. Dennis Mortensen, CEO and founder of x.ai, maker of AI-based virtual assistant Amy, agreed. “I look at our firm and two-thirds of the jobs here didn’t exist a few years ago,” said Mortensen.

In addition to creating new jobs, AI will also help people do their jobs better — a lot better. At the World Economic Forum in Davos, Paul Daugherty, Accenture’s Chief Technology and Innovation Officer summed this idea up as, “Human plus machine equals superpowers.” 

Potential to transform businesses and contribute to economic growth:

These technologies are already generating value in various products and services, and companies across sectors use them in an array of processes to personalize product recommendations, find anomalies in production, identify fraudulent transactions, and more. The latest generation of AI advances, including techniques that address classification, estimation, and clustering problems, promises significantly more value still. An analysis we conducted of several hundred AI use cases found that the most advanced deep learning techniques deploying artificial neural networks could account for as much as $3.5 trillion to $5.8 trillion in annual value, or 40 percent of the value created by all analytics techniques. 

Deployment of AI and automation technologies can do much to lift the global economy and increase global prosperity, at a time when aging and falling birth rates are acting as a drag on growth. Labor productivity growth, a key driver of economic growth, has slowed in many economies, dropping to an average of 0.5 percent in 2010–2014 from 2.4 percent a decade earlier in the United States and major European economies, in the aftermath of the 2008 financial crisis after a previous productivity boom had waned. AI and automation have the potential to reverse that decline: productivity growth could potentially reach 2 percent annually over the next decade, with 60 percent of this increase from digital opportunities.

Work Cited:

Artificial intelligence – Wikipedia

The Role of Artificial Intelligence in the Future of Work | Blogs | CDC

AI, automation, and the future of work: Ten things to solve for (Tech4Good) | McKinsey

From the blog CS@Worcester blog – Syed Raza by syedraza089 and used with permission of the author. All other rights reserved by the author.

Anestiblog #4

This week I read a blog post that I thought really related to the class about why software development is important. The blog is about a deep dive into the career of a software developer. It starts off describing software developers as the masterminds behind computer programs. The blog then gives what different types of software developers do, like how applications software developers are responsible for designing computer or phone apps, and systems software developers are responsible for operating systems level software. Afterwards , the skills needed for software developers are shown. Some of the skills are problem-solving skills, teamwork, motivation, and analytical strategy. The blog ends with the salary of software developers($110,000), and a message to motivate the reader for the future. I selected this blog post because software development is my dream job, and I thought it would be interesting to read about what I should expect for the future job. This blog has a good, in-depth description of how Software Development works, that I think every CS major should read. I think this blog was a great read that I recommend for many reasons. One reason I would recommend this blog is because of how deep it goes into the job of a software developer. The blog goes over what to expect, skills needed, the pay, and does it all at a high level. Another reason I would recommend this blog is because a lot of jobs that we need CS-343 for will all be similar to software development, so even if you do not want to become a software developer, you can still learn something. The last reason I would recommend this blog is because it could get people who don’t like software development into the area by showing them what to expect from the job. Knowing what to expect could really help open the doors for others to be interested in this field. I learned how many of the skills that are needed for software developers I have already like Java, and I also learned the skills that I have not learned yet like DevOps. The material affected me heavily because it showed me what skills to learn, and what to expect if I want my future dream of software development to come true. I will take all the knowledge given to me through this blog into the future by getting better prepared to do this job. Now that I know what to expect from software development, I will try to build on it for the future.

https://www.rasmussen.edu/degrees/technology/blog/what-does-software-developer-do/

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

Concurrency and Parallelism

In our most recent class, one of our in class activities mentioned asynchronicity for a JavaScript function. This function required us to use the “await” keyword for us getting data. I’d thus thought of doing a post on concurrency, but in my experience in using concurrency, I’ve noticed myself and others struggling with the difference between concurrency and parallelism. Hence, in order to clearly understand concurrency, I wish to also describe parallelism. 

An application that is neither parallel nor concurrent is one that is processed sequentially, typically one “where it only has a single job that is too small to make sense to parallelize.1

Parallelism is simply the separation of a task into multiple sub tasks. These sub tasks are simply parallel if they are worked on sequentially. If two or more sub tasks are being worked at the same time, the program is implementing both parallelism and concurrency.

Concurrency is the act of an application working on two or more parts of an application at the same time. One thread could be running through an array, while another is doing a separate calculation. If an application is running without implementing parallelism, then it is working on each part of the application.

An application that is both parallel and concurrent can partition parts of the application and executes the program’s sub tasks concurrently. It may also include programs that divide a subtask into further subtasks and run those concurrently too.

I picked this particular source because it articulates the difference between concurrency and parallelism, rather than just one or the other. It also has a section that shows the permutations of implementing concurrency, parallelism, both, or neither. Even though I know about parallelism and concurrency, this article in particular helped me visualize them. I did not know that one could implement concurrency without parallelism. 

I feel as through this article will help me understand some elements of homework #5, because it will likely include functions that are asynchronous, and therefore require us to acknowledge it by properly implementing the “await” keyword. While this article was oriented towards locally run applications, this will also aid with applications that are executed to and from servers, by which the topics of parallelism and concurrency will still render useful.

I have also created a program that attempts to implement concurrent execution between multiple sub tasks that exist from implementing parallelism, which this article helped me understand. Specifically, I generate a vector with integers, then split the vector into subtasks which are then run concurrently. Each vector sub task gives the average sum of their respective sub task. 

Links:

  1. http://tutorials.jenkov.com/java-concurrency/concurrency-vs-parallelism.html (the proper article sourced for the information)
  2. https://github.com/Chris-Archive/Vector-Parallelism-Concurrency (my GitHub repository of the example I used above in C++)

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

Architectural Pattern vs Architectural Styles. #4

An Architectural Pattern is a named collection of architectural design decisions that are applicable to a recurring design problem parameterized to account for different software development contexts in which that problem appears.

An Architectural Style is a named collection of architectural design decisions that (1) are applicable in a given development context, (2) constrain architectural design decisions that are specific to a particular system within that context, and (3) elicit beneficial qualities in each resulting system.

In simple words, the main difference between them is that An Architectural Pattern is a way of solving a recurring architectural problem. MVC, for instance, solves the problem of separating the UI from the model. Sensor-Controller-Actuator, is a pattern that will help you with the problem of actuating in face of several input senses.

An Architectural Style, on the other hand, is just a name given to a recurrent architectural design. Contrary to a pattern, it doesn’t exist to “solve” a problem. Pipe&filter doesn’t solve any specific problem, it’s just a way of organizing your code. Client/server, Main program & subroutine and Abstract Data Types / OO, the same.

A single architecture can contain several Architectural Styles, and each Architectural Style can make use of several Architectural Patterns. An Architecture Patterns can be a subset of an Architectural Styles targeting a specific scope.

Here are some examples of architectural patterns:

  • Multitier architecture
  • Model–view–controller: divides an interactive application in to 3 parts as,
    • model — contains the core functionality and data
    • view — displays the information to the user (more than one view may be defined)
    • controller — handles the input from the user
  • Domain-driven design: the idea is to design software based on the Business Domain, its elements and behaviors, and the relationships between them.
  • Blackboard pattern: This pattern is useful for problems for which no deterministic solution strategies are known. The blackboard pattern consists of 3 main components.
    • blackboard — a structured global memory containing objects from the solution space
    • knowledge source — specialized modules with their own representation
    • control component — selects, configures and executes modules.
  • Sensor–controller–actuator
  • Presentation–abstraction–control

Here are some examples of architectural styles:

  • Component-based
  • Monolithic application
  • Layered: This pattern is used to structure programs that can be decomposed into groups of subtasks. It partitions the concerns of the application into layers.
  • Pipes and filters: It consist of any number of components, called Filters, that transform or filter data, before passing it to other components through connectors called Pipes.
  • Event-driven: Also called EDA, this pattern organizes a system around the production, detection and consumption of events.
  • Publish-subscribe
  • Plug-ins
  • Client-server: This pattern consists of two parties; a server and multiple clients. The server component will provide services to multiple client components.
  • Service-oriented

Helpful resources:

10 Common Software Architectural Patterns in a nutshell | by Vijini Mallawaarachchi | Towards Data Science

List of software architecture styles and patterns – Wikipedia

Architectural Styles and Architectural Patterns | by Mátyás Lancelot Bors | Medium

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

Design Smells

Hello everyone and welcome to my blog! This week I decided to write a blog on design smells. In programming, we write a lot of code and even a small mistake in the code tends to break the whole program which brings down the efficiency of the code. Design smells refer to the mistakes in the code that had to do with the way the programmer wrote the code which then tends to make a lot of problems due to the design on how the code is written. Design smells are structures in the design that indicate a violation of fundamental design principles and negatively impact design quality. If a programmer focuses less on code design, later the program tends to break easily even if a small feature needs to be added to it. In the article, Mr. Fowler says code smell is a surface indication that usually corresponds to a deeper problem in the system. Design smells are easy to spot if we know about them and what they are, hence, some of the common design smells are:

Rigidity: The program breaks if a single change is made in the code, hence had to go back, and make several changes to make the code work.

  • Immobility: the parts of the code if can be used in other system can’t be moved because of the high risk of breaking the original code.
  • Fragility: changes in the code that could make error in the different unrelated parts to the program, hence making it difficult to even change small section of the code.
  • Viscosity: Making the changes in the program in a right way is harder hence, code is easy to be broken.
  • Needless Complexity: having the code that is not useful and make the code hard to understand.
  • Needless Repetition: Various Repetition of functions in the code can be removed by refactoring the program.
  • Opacity: The functionality of a system or feature is unclear, or the code is unclear and very difficult to understand.

I choose this article because as a programmer above things are something we don’t want in our code, by learning about design smells one can know where to find it in the code and once you find it following the best practices such as refactoring can help solve design smells. As a programmer in the future knowing about these design smells helps me later in my everyday task in my job.

Links used:

https://martinfowler.com/bliki/CodeSmell.html

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

Items API

The API is the most important aspect of web development. The program’s functionality is divided between the front end and the back end. Our assignment has been based on the front end since this week. Create, delete, list, update, and order items, among other things. To help you comprehend the entire process, I’ve created a rudimentary image that will aid with the demonstration’s layout.

Front-end web development, sometimes referred to as client-side development, is the process of creating HTML, CSS, and JavaScript for a website or Web application so that a user can see and interact with it directly. The difficulty with front end development is that the tools and techniques used to produce the front end of a website change all the time, necessitating the developer’s ongoing awareness of how the field evolves.

In an app, items are entries. Items are the rows in the table if you conceive of the app as a table. Items are made up of some basic information as well as values for each of the app’s fields. There can be many values (for example, several links to another app) and multiple sorts of values for each field (F.ex. a field of type date field consists of both a start date and an optional end date). A string id called a sub id is used to identify the type. The sub id values denote the kind of most fields, which is usually only one. Others have a number of sub ids. For each field, the sub ids and their values are provided below:

The Items API allows you to:

Verb             Path                                    Action                    Description

POST          /api/items                              create                    Create item

GET           /api/items/:id/image            image                   /api/items/:id/image

GET           /api/items                              index                     Query items

GET            /api/items/:id                        show                      Show item

PATCH      /api/items/:id                         update                   Update item

PUT           /api/items/:id                         update                   Update item

It takes a combination of programming, arithmetic, and human interaction to turn a visual design into a fully working  web design.

This will have an impact on you. HTML is loaded into a browser and interacts with other resources such as CSS and JavaScript to create a website. You may not be writing the code, but there are dozens of elements that a developer must consider in order to make this work, and you should be aware of these demands and effects, as well as the fundamental tools of the trade.

Developers have come to identify and specialize with one side of the front-end/back-end duality as both sides have become increasingly complicated. Most web engineers made a career decision about whether they wanted to work on the front-end or the back-end somewhere in the previous ten years, and new developers are making the same decision today: Do they want to work with front-end, presentation-level code, or back-end, processing-level code? It’s up to you to decide.

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

REST APIs

My experience with APIs outside of classwork is very limited, so I wanted to take this opportunity to further familiarize myself with them. After a discussion in class, I am especially eager to learn more about REST APIs and how they might differ from other APIs. Jamie Juviler’s “REST APIs: How They Work and What You Need to Know” is a very good start.

Introduced in 2000 by Roy Fielding, REST APIs are application programming interfaces that follow REST guidelines. REST, which stands for representational state transfer, enables software to be able to communicate over the internet in a way that is scalable and easily integrated. According to Juviler, “when a client requests a resource using a REST API, the server transfers back the current state of the resource in a standardized representation.” REST APIs are a popular solution for many web apps. They are able to handle a wide variety of requests and data, easy to scale, and simple to build as they utilize web technologies that already exist.

REST guidelines offer APIs increased functionality. Juviler states that in order for an API to properly take advantage of REST’s functionality, it must abide by a set of rules: client-server separation, uniform interface, stateless, layered system, cacheable, and code on demand. Client-server separation addresses the way a client communicates with a server. A client sends the server a request, and the server sends that client a response. Communication cannot happen in the other direction; a server cannot send a request nor can a client send a response. Uniform interface addresses the formatting of requests and responses. This standardized the formatting and makes it easier for servers and softwares to talk to each other. Stateless requires calls made with a REST API to be stateless. Each request to the server is dealt with completely independent of other requests. This eases the use of the server’s memory. Layered system states that, regardless of the possible existence of intermediate servers, messages between the client and main server should have the same format and method of processing. Cacheable requires that a server’s response to a client include information about if and for how long the response can be cached. Code on demand is an optional rule. It allows a server to send code as part of a response so that the client can run it.

I picked this source because I thought the information was valuable. Again, I have very limited experience with APIs, even less with REST APIs, and I struggled somewhat to understand them. Jamie Juliver provides a very thorough yet easily understood overview of REST APIs. I was not aware that what sets a REST API apart from a regular API was its adherence to a set of rules. This article helped me better understand REST APIs, and I am eager to put this knowledge to use in future coursework and projects.

From the blog CS@Worcester – Ciampa's Computer Science Blog by robiciampa and used with permission of the author. All other rights reserved by the author.