Author Archives: syedraza089

Design patterns

A design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn’t a finished design that can be transformed directly into code. It is a description or template for how to solve a problem that can be used in many different situations. 

The main goal of using design patterns is to make the code easy to maintain, hence reducing the maintainability costs. Design patterns are split into several groups: creational patterns, structural patterns, and behavioral patterns.

Creational Patterns:

Creational patterns are used to create objects for a suitable class that serves as a solution for a problem. Generally when instances of several different classes are available. They are particularly useful when you are taking advantage of polymorphism and need to choose between different classes at runtime rather than compile time. Creational patterns support the creation of objects in a system. Creational patterns allow objects to be created in a system without having to identify a specific class type in the code, so you do not have to write large, complex code to instantiate an object. It does this by having the subclass of the class create the objects. However, this can limit the type or number of objects that can be created within a system.

There are 6 types of creational design patterns.

  1. Factory Method Pattern
  2. Abstract Factory Pattern
  3. Singleton Pattern
  4. Prototype Pattern
  5. Builder Pattern
  6. Object Pool Pattern

Structural Patterns: 

Structure diagrams depict the static structure of the elements in your system. i.e., how one object relates to another. It shows the things in the system – classes, objects, packages or modules, physical nodes, components, and interfaces. Since structure diagrams represent the structure, they are used extensively in documenting the software architecture of software systems. Structural patterns form larger structures from individual parts, generally of different classes. Structural patterns vary a great deal depending on what sort of structure is being created for what purpose.

There are 7 types of structural design patterns.

  1. Adapter Pattern
  2. Bridge Pattern
  3. Composite Pattern
  4. Decorator Pattern
  5. Facade Pattern
  6. Flyweight Pattern
  7. proxy Pattern

Behavioral Patterns:

Behavioral design patterns are concerned with the interaction and responsibility of objects. In these design patterns, the interaction between the objects should be in such a way that they can easily talk to each other and still should be loosely coupled. That means the implementation and the client should be loosely coupled in order to avoid hard coding and dependencies.

There are 12 types of behavioral design patterns.

  1. Chain of Responsibility Pattern
  2. Command Pattern
  3. Interpreter Pattern
  4. Iterator Pattern
  5. Mediator Pattern
  6. Memento Pattern
  7. Observer Pattern
  8. State Pattern
  9. Strategy Pattern
  10. Template Pattern
  11. Visitor Pattern
  12. Null Object

Design Patterns – Wikipedia

Behavioral Design Patterns – Javatpoint

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

GRASP (General Responsibility Assignment Software Patterns)

GRASP (General Responsibility Assignment Software Patterns) is a design pattern in object-oriented software development used to assign responsibilities for different modules of code. GRASP is a set of “nine fundamental principles in object design and responsibility assignment”, first published by Craig Larman in 1997 in a book “Applying UML and Patterns”.

GRASP is occasionally coupled with other design patterns such as SOLID. Design patterns such as these help keep code simpler, more organized, more comprehensible, analyzable and reusable.

Patterns:

In object-oriented design, a pattern is a named description of a problem and solution that can be applied in new contexts; ideally, a pattern advises us on how to apply its solution in varying circumstances and considers the forces and trade-offs. Many patterns, given a specific category of problem, guide the assignment of responsibilities to objects.

This is the list of 9 GRASP patterns.

  1. Creator
  2. Information Expert
  3. Low Coupling
  4. Controller
  5. High Cohesion
  6. Indirection
  7. Polymorphism
  8. Protected Variations
  9. Pure Fabrication

Creator: 

Takes responsibility for creating certain other objects. It has information on how to create objects. It can be used to enforce the logical design of a system.

Information Expert:

The information expert pattern states that we need to assign responsibilities to the right expert.

Low coupling: 

One of the major GRASP principles is Low Coupling. Coupling is a measure of how strongly one object is connected to, has knowledge of, or depends upon other objects. 

Controller:

Controller is responsible for handling the actions of user-interfaces. The controller is the first object to receive a command from the UI.

High cohesion: 

High cohesion is an evaluative pattern that attempts to keep objects appropriately focused, manageable and understandable. High cohesion is generally used in support of low coupling.

Indirection: 

The indirection pattern supports low coupling and reuses potential between two elements by assigning the responsibility of mediation between them to an intermediate object.

Polymorphism:

According to the polymorphism principle, responsibility for defining the variation of behaviors based on type is assigned to the type for which this variation happens. This is achieved using polymorphic operations. The user of the type should use polymorphic operations instead of explicit branching based on type.

Protected variations:

A pattern that protects elements from the variations on other elements by wrapping the focus with an interface and using polymorphism to create various implementations.

Pure Fabrication: 

A class that does not represent a concept in the problem domain. This kind of class is called a “service” in domain-driven design.

GRASP (object-oriented design) – CodeDocs

GRASP (object-oriented design) – Wikipedia

GRASP Patterns – Beyond Velocity

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

Object-oriented programming

Object-oriented programming (OOP) is a programming paradigm based on the concept of “objects”, which can contain data and code. It is used by nearly every developer at some point in their career. OOP is the most popular programming paradigm in the field of computer science. It relies on the concept of classes and objects. It is used to structure a software program into simple, reusable pieces of code blueprints. There are many object-oriented programming languages including JavaScript, C++, Java, and Python. 

Objects:

This is the basic unit of object-oriented programming. Object can be a combination of variables, functions, and data structures, in particular in class-based variations of the paradigm it refers to a particular instance of a class. Objects can be declared several times depending on the requirements.

Classes: 

Classes are a blueprint or a set of instructions to build a specific type of object. It is also a basic concept of Object-Oriented Programming which revolves around real-life entities. Class in Java determines how an object will behave and what the object will contain. A class is used to bind data as well as methods together in a single unit.

Principles of OOP:

There are four principles of object oriented programming(OOP).

  1. Inheritance
  2. Encapsulation
  3. Abstraction
  4. Polymorphism

Inheritance:

Inheritance is a mechanism of acquiring the features and behaviors of a class by another class. Using inheritance, we can create a derived class from a base class such that it inherits the properties and methods of the parent class(base class) and can have its own additional properties and methods. The derived class is also known as the child class.

There are 6 different types of inheritance in OOP.

  1. Single inheritance
  2. Multi-level inheritance
  3. Multiple inheritance
  4. Multipath inheritance
  5. Hierarchical Inheritance
  6. Hybrid Inheritance

Encapsulation: 

Encapsulation means carrying all the important information inside an object. encapsulation is also often used to hide the internal state of an object from the outside. This process is called information hiding. The general idea of this mechanism is that If you have an attribute that is not visible from the outside of an object, and bundle it with methods that provide read or write access to it, then you can hide specific information and control access to the internal state of the object. 

In Encapsulation, Only public methods and attributes are accessible from the outside. Code is hidden in a class, only public methods are accessible by the outside developers.

Abstraction:

In Object Oriented Programming, abstraction means implementation is hidden from the user and only required functionality will be accessible or available to the user. Abstraction uses simplified high level tools to access a complex object. Abstraction is an extension of encapsulation.

Abstraction also plays an important security role by only displaying specific or selected data to users.  

Polymorphism:

The word polymorphism means having many forms. Using inheritance, objects can override shared parent behaviors, with specific child behaviors. Polymorphism allows the same method to execute different behaviors in two ways: method overriding and method overloading.

What is Object Oriented Programming? OOP Explained in Depth (educative.io)

What is object-oriented programming (OOP)? (tutorialspoint.com)

Object-oriented programming – Wikipedia

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

Unified Modeling Language (UML)

The Unified Modeling Language (UML) is a general-purpose, developmental, modeling language in the field of software engineering that is intended to provide a standard way to visualize the design of a system. The creation of UML was originally motivated by the desire to standardize the disparate notational systems and approaches to software design. It was developed at Rational Software in 1994–1995, with further development led by them through 1996.

UML offers a way to visualize a system’s architectural blueprints in a diagram. The UML represents a collection of best engineering practices that have proven successful in the modeling of large and complex systems. The UML is a very important part of developing object oriented software and the software development process.

UML has many types of diagrams, which are divided into two categories. Some types represent structural information, and the rest represent general types of behavior, including a few that represent different aspects of interactions.

Class Diagram

A Class Diagram in Software engineering is a static structure that gives an overview of a software system by displaying classes, attributes, operations, and their relationships between each other. This Diagram includes the class name, attributes, and operation in separate designated compartments.

 

Structure diagrams

Structure diagrams show the static structure of the system and its parts on different abstraction and implementation levels and how they are related to each other. Since structure diagrams represent the structure, they are used extensively in documenting the software architecture of software systems. Structural Diagrams include: Component Diagrams, Object Diagrams, Class Diagrams and Deployment Diagrams.

Behavior diagrams

Behavior diagrams show the dynamic behavior of the objects in a system, which can be described as a series of changes to the system over time; They are used extensively to describe the functionality of software systems. Behavior diagrams include: Use Case Diagrams, State Diagrams, Activity Diagrams and Interaction Diagrams.

Interaction overview diagrams

The Interaction Overview Diagram focuses on the overview of the flow of control of the interactions.The Interaction Overview Diagram describes the interactions where messages and lifelines are hidden. You can link up the “real” diagrams and achieve a high degree of navigability between diagrams inside the Interaction Overview Diagram.

UML 2.0

UML 2.0 has been an industry standard focusing on model-driven application integration. UML 2.0 is capable of providing better semantics or definitions. It has also worked to improve the internal structuring. UML 2.0 adds the definition of formal and completely defined semantics. This new possibility can be utilized for the development of models and the corresponding systems can be generated from these models.

Unified Modeling Language – Wikipedia

What is Unified Modeling Language (UML)? (visual-paradigm.com)

What is UML | Unified Modeling Language

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

REST API

REST APIs provide a flexible, lightweight way to integrate applications, and have emerged as the most common method for connecting components in microservices architectures.

How Does REST API Work: 

Through HTTP, a REST API communicates its request to perform functions like reading, creating, deleting, and updating records within a resource. For example, a REST API receives a request to retrieve a record, a POST to create one, a PUT to update a record, and a DELETE to get rid of one. 

The Six Rules of REST API’s:

There are six REST design principles – also known as architectural constraints, When these constraints are applied to the system architecture, it gains desirable non-functional properties, such as performance, scalability, simplicity, modifiability, visibility, portability, and reliability. A system that complies with some or all of these constraints is loosely referred to as RESTful.

  1. Uniform interface: A uniformed interface within the architecture of the REST API allows the client to interact with the server in one specific language. It also provides for the independent evolution without conjoining its functions to the API.
  1.  Client-Server Separation: The client sends a request to the server, then the server sends a response back to the client. Servers cannot make requests and clients cannot respond — all interactions are initiated by the client. RESTful APIs keep the two conveniently independent. This way, client software can grow their builds without worrying about affecting any other servers, and server contents can be modified without inadvertently affecting clients.
  1. Stateless: As per the REST architecture, a RESTful Web Service should not keep a client state on the server. This restriction is called Statelessness. It is the responsibility of the client to pass its context to the server and then the server can store this context to process the client’s further request.
  1. Layered API System Architecture: As APIs create a communication interface that hides the interactions between them, users don’t get to experience exactly how the services connect. REST APIs send calls and responses through various layers to make the end-user experience smoother. 
  1. Cache-ability: Caching occurs when media is stored on a client’s device when visiting a website. cacheability of resources on either the server or client-side should be possible. This improves scalability, speed, and/or performance.
  1. Code on Demand: its primary duty is to allow for applets and code transmission through the API and use by the application. Simply, it enables the client’s flexibility.

Work cited:

What is uniform interface in rest? (askinglot.com)

Uniform Interface – an overview | ScienceDirect Topics

REST APIs: How They Work and What You Need to Know – 2021 (smarttechdata.com)

From the blog CS@Worcester blog – Syed Raza by syedraza089 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.

Where Programming, AI and Cloud are headed in 2021?

This study is based on title usage on O’Reilly online learning. The data includes all usage of O’reilly platform, not just content that O’Reilly has published, and certainly not just books. I have included search data in the graphs.

Programming languages:

In the first figure, you can see year-over-year growth in usage, and the number of search queries for several popular languages. The top programming languages according to O’reilly are Python (up 27%), Java (down 3%), C++ (up 10%), C (up 12%), and JavaScript (up 40%). Looking at 2020 usage rather than year-over-year changes, it’s surprising to see JavaScript so far behind Python and Java. (JavaScript usage is 20% of Python’s, and 33% of Java’s).

Past the top five languages, Go has grown 16% and Rust has grown 94%. Go has clearly established itself, particularly as a language for concurrent programming, and Rust is likely to establish itself for “system programming”

Figure 2 shows what happens when you add the use of content about Python, Java, and JavaScript to the most important frameworks for those languages.

Adding usage and search query data for Spring (up 7%) reverses Java’s apparent decline (net-zero growth). Looking further at JavaScript, if you add in usage for the most popular frameworks (React, Angular, and Node.js), JavaScript usage on O’Reilly online learning rises to 50% of Python’s, only slightly behind Java and its frameworks.

None of these top languages are going away, though their stock may rise or fall as fashions change and the software industry evolves.

We see several factors changing pro‐ gramming in significant ways:

Multi Paradigm languages:

Since last year, According to O’reilly there is a 14% increase in the use of content on functional programming. Object oriented programming is up even more than 29% growth as compared to functional programming since last year. Starting with Python 3.0 in 2008 and continuing with Java 8 in 2014, programming languages have added higher-order functions (lambdas) and other “functional” features. Several popular languages (including JavaScript and Go) have had functional features from the beginning. This trend started over 20 years ago (with the Standard Template Library for C++), and we expect it to continue.  

Concurrent programming:

Platform data for concurrency shows an 8% year-over-year increase.Java was the first widely used language to support concurrency as part of the language.Go, Rust, and most other modern languages have built-in support for concurrency. Concurrency has always been one of Python’s weaknesses.

Dynamic versus static typing:

The distinction between languages with dynamic typing (like Ruby and JavaScript) and statically typed languages (like Java and Go) is arguably more important than the distinction between functional and object-oriented languages. Python 3.5 added type hinting, and more recent versions have added additional static typing features. TypeScript, which adds static typing to JavaScript, is coming into its own (12% year-over-year increase).

Low-code and no-code computing: 

low-code is real and is bound to have an effect.Spreadsheets were the forerunner of low-code computing. When VisiCalc was first released in 1979, it enabled millions to do significant and important computation without learning a programming language. Democratization is an important trend in many areas of technology; it would be surprising if programming were any different.

AI, Machine Learning, and Data:

Healthy growth in artificial intelligence has continued: machine learning is up 14%, while AI is up 64%; data science is up 16%, and statistics is up 47%. While AI and machine learning are distinct concepts, there’s enough confusion about definitions that they’re frequently used interchangeably. We informally define machine learning as “the part of AI that works”; AI itself is more research oriented and aspirational. If you accept that definition, it’s not surprising that content about machine learning has seen the heaviest usage: it’s about taking research out of the lab and putting it into practice. It’s also not surprising that we see solid growth for AI, because that’s where bleeding-edge engineers are looking for new ideas to turn into machine learning.

It’s possible that AI (along with machine learning, data, big data, and all their fellow travelers) is descending into the trough of the hype cycle. We don’t think so, but we’re prepared to be wrong. As Ben Lorica has said (in conversation), many years of work will be needed to bring current research into commercial products. 

The future of AI and machine learning:

  • Many companies are placing significant bets on using AI to automate customer service. We’ve made great strides in our ability to synthesize speech, generate realistic answers, and search for solutions.
  •  We’ll see lots of tiny, embedded AI systems in everything from medical sensors to appliances to factory floors. Anyone interested in the future of technology should watch Pete Warden’s work on TinyML very carefully.
  • Natural language has been (and will continue to be) a big deal. GPT-3 has changed the world. We’ll see AI being used to create “fake news,” and we’ll find that AI gives us the best tools for detecting what’s fake and what isn’t.

Web Development:

Since the invention of HTML in the early 1990s, the first web servers, and the first browsers, the web has exploded (or degenerated) into a proliferation of platforms. Those platforms make web development infinitely more flexible: They make it possible to support a host of devices and screen sizes. They make it possible to build sophisticated applications that run in the browser. And with every new year, “desktop” applications look more old-fashioned.

The foundational technologies HTML, CSS, and JavaScript are all showing healthy growth in usage (22%, 46%, and 40%, respectively), though they’re behind the leading frameworks. We’ve already noted that JavaScript is one of the top programming languages—and the modern web platforms are nothing if not the apotheosis of JavaScript. Twenty-five years later, that’s no longer true: you can still “view source,” but all you’ll see is a lot of incomprehensible JavaScript. Ironically, just as other technologies are democratizing, web development is increasingly the domain of programmers.

Clouds of All Kinds:

It’s no surprise that the cloud is growing rapidly. Usage of content about the cloud is up 41% since last year. Usage of cloud titles that don’t mention a specific vendor (e.g., Amazon Web Services, Microsoft Azure, or Google Cloud) grew at an even faster rate (46%). Our customers don’t see the cloud through the lens of any single platform. We’re only at the beginning of cloud adoption; while most companies are using cloud services in some form, and many have moved significant business-critical applications and datasets to the cloud, we have a long way to go. If there’s one technology trend you need to be on top of, this is it.

The horse race between the leading cloud vendors, AWS, Azure, and Google Cloud, doesn’t present any surprises. Amazon is winning, even ahead of the generic “cloud”—but Microsoft and Google are catching up, and Amazon’s growth has stalled (only 5%). Use of content about Azure shows 136% growth—more than any of the competitors—while Google Cloud’s 84% growth is hardly shabby. When you dominate a market the way AWS dominates the cloud, there’s nowhere to go but down. But with the growth that Azure and Google Cloud are showing, Amazon’s dominance could be short-lived.

While our data shows very strong growth (41%) in usage for content about the cloud, it doesn’t show significant usage for terms like “multi cloud” and “hybrid cloud” or for specific hybrid cloud products like Google’s Anthos or Microsoft’s Azure Arc. These are new products, for which little content exists, so low usage isn’t surprising. But the usage of specific cloud technologies isn’t that important in this context. usage of all the cloud platforms is growing, particularly content that isn’t tied to any vendor. We also see that our corporate clients are using content that spans all the cloud vendors; it’s difficult to find anyone who’s looking at a single vendor.

Security and Privacy:

Security has always been a problematic discipline: defenders have to get thousands of things right, while an attacker only has to discover one mistake. And that mistake might have been made by a careless user rather than someone on the IT staff. 

CISSP content and training is 66% of general security content, with a slight (2%) decrease since 2019. Usage of content about the CompTIA Security+ certification is about 33% of general security, with a strong 58% increase. 

It’s disappointing that we see so little interest in content about privacy, including content about specific regulatory requirements such as GDPR. We don’t see heavy usage; we don’t see growth; we don’t even see significant numbers of search queries.

Work cited: 

Google

Where Programming, Ops, AI, and the Cloud are Headed in 2021 – O’Reilly (oreilly.com)

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

Introduction

Hello, My name is Syed Minhal Raza. My major is Computer Science and I am a junior student at Worcester State University

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