Category Archives: CS-343

week-3

Hello,

I am doing some class activities and looking over some questions ahead to save time for a thing or two. I came across the word “Behavioral Patterns” in class Act. 4 (Model 8); I got curious and looked it up. I found two articles that helped me understand the purposes, Problems with solutions, Real-World Analogy, Structure, Pseudo-code, Applicability, How to Implement, Pros and Cons, Relations with Other Patterns.

The Behavioral Patterns are concerned with providing solutions. It is about object interaction – how they communicate, how some are dependent on others, how to separate them to be both dependent and independent, and give both flexibility and testing capabilities—also, the assignment of responsibilities between objects.

The Behavioral Patterns cover many small parts to form the full extend of patterns. Like Interpreter, Template Method/Pattern, Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, and Visitor.

Interpreter

The Interpreter pattern: Evaluate any language grammar or expressions. An excellent example; this pattern would be Google Translate, which deciphers the input, and shows us the output in another language. Another example would be the Java compiler. The compiler interprets Java code and translates it into byte-code that the JVM uses to perform operations on the device it runs on. Also, it represents a great way to write simple programs that understand human-like syntax. 

Chain of Responsibility – pass requests along a chain of handlers. Upon receiving a request, each handler processes the requestor gives it to the next handler in the chain. 

Command – Turns a request into a stand-alone object that contains all information about the proposal. This transformation lets pass requests as a method arguments, delay or queue a request’s execution, and support undo-able operations. 

Iterator – traverse elements of a collection without exposing its underlying representation (list, stack, tree, etc.)

Mediator – it reduces chaotic dependencies between objects. The pattern restricts direct communications between the entities and forces them to collaborate only via a mediator object.

Memento – it saves and restores the previous state of an object without revealing the details of its implementation.

Observer – define a subscription mechanism to notify multiple objects about any events to the observed entity.

State – lets an object alter its behavior when its internal state changes. It appears as if the thing changed its class.

Strategy – define a family of algorithms, put them into a separate class, and make their objects interchangeable.

Template Method – the outline of an algorithm in the super-class but lets sub-classes revoke exact steps of the algorithm without modifying its structure.

Visitor – It separates algorithms from the objects on which they operate.

 

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

week-3

Hello,

I am doing some class activities and looking over some questions ahead to save time for a thing or two. I came across the word “Behavioral Patterns” in class Act. 4 (Model 8); I got curious and looked it up. I found two articles that helped me understand the purposes, Problems with solutions, Real-World Analogy, Structure, Pseudo-code, Applicability, How to Implement, Pros and Cons, Relations with Other Patterns.

The Behavioral Patterns are concerned with providing solutions. It is about object interaction – how they communicate, how some are dependent on others, how to separate them to be both dependent and independent, and give both flexibility and testing capabilities—also, the assignment of responsibilities between objects.

The Behavioral Patterns cover many small parts to form the full extend of patterns. Like Interpreter, Template Method/Pattern, Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, and Visitor.

Interpreter

The Interpreter pattern: Evaluate any language grammar or expressions. An excellent example; this pattern would be Google Translate, which deciphers the input, and shows us the output in another language. Another example would be the Java compiler. The compiler interprets Java code and translates it into byte-code that the JVM uses to perform operations on the device it runs on. Also, it represents a great way to write simple programs that understand human-like syntax. 

Chain of Responsibility – pass requests along a chain of handlers. Upon receiving a request, each handler processes the requestor gives it to the next handler in the chain. 

Command – Turns a request into a stand-alone object that contains all information about the proposal. This transformation lets pass requests as a method arguments, delay or queue a request’s execution, and support undo-able operations. 

Iterator – traverse elements of a collection without exposing its underlying representation (list, stack, tree, etc.)

Mediator – it reduces chaotic dependencies between objects. The pattern restricts direct communications between the entities and forces them to collaborate only via a mediator object.

Memento – it saves and restores the previous state of an object without revealing the details of its implementation.

Observer – define a subscription mechanism to notify multiple objects about any events to the observed entity.

State – lets an object alter its behavior when its internal state changes. It appears as if the thing changed its class.

Strategy – define a family of algorithms, put them into a separate class, and make their objects interchangeable.

Template Method – the outline of an algorithm in the super-class but lets sub-classes revoke exact steps of the algorithm without modifying its structure.

Visitor – It separates algorithms from the objects on which they operate.

 

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

week-3

Hello,

I am doing some class activities and looking over some questions ahead to save time for a thing or two. I came across the word “Behavioral Patterns” in class Act. 4 (Model 8); I got curious and looked it up. I found two articles that helped me understand the purposes, Problems with solutions, Real-World Analogy, Structure, Pseudo-code, Applicability, How to Implement, Pros and Cons, Relations with Other Patterns.

The Behavioral Patterns are concerned with providing solutions. It is about object interaction – how they communicate, how some are dependent on others, how to separate them to be both dependent and independent, and give both flexibility and testing capabilities—also, the assignment of responsibilities between objects.

The Behavioral Patterns cover many small parts to form the full extend of patterns. Like Interpreter, Template Method/Pattern, Chain of Responsibility, Command, Iterator, Mediator, Memento, Observer, State, Strategy, and Visitor.

Interpreter

The Interpreter pattern: Evaluate any language grammar or expressions. An excellent example; this pattern would be Google Translate, which deciphers the input, and shows us the output in another language. Another example would be the Java compiler. The compiler interprets Java code and translates it into byte-code that the JVM uses to perform operations on the device it runs on. Also, it represents a great way to write simple programs that understand human-like syntax. 

Chain of Responsibility – pass requests along a chain of handlers. Upon receiving a request, each handler processes the requestor gives it to the next handler in the chain. 

Command – Turns a request into a stand-alone object that contains all information about the proposal. This transformation lets pass requests as a method arguments, delay or queue a request’s execution, and support undo-able operations. 

Iterator – traverse elements of a collection without exposing its underlying representation (list, stack, tree, etc.)

Mediator – it reduces chaotic dependencies between objects. The pattern restricts direct communications between the entities and forces them to collaborate only via a mediator object.

Memento – it saves and restores the previous state of an object without revealing the details of its implementation.

Observer – define a subscription mechanism to notify multiple objects about any events to the observed entity.

State – lets an object alter its behavior when its internal state changes. It appears as if the thing changed its class.

Strategy – define a family of algorithms, put them into a separate class, and make their objects interchangeable.

Template Method – the outline of an algorithm in the super-class but lets sub-classes revoke exact steps of the algorithm without modifying its structure.

Visitor – It separates algorithms from the objects on which they operate.

 

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

Website Architecture

“If your business is not on the internet, then your business will be out of business.” — Bill Gates. In this Industry 4.0 era, this stated is still reasonable for most case. In order to grow and to maintain the business, one major point is to gain more attention through the Internet. Out of any methods, owning a business’s website is a must as a face of the company on the social networking environment.

Therefore, it’s important to understand the structure of a website as a developer and this blog here from HubSpot explaining what website architecture is and providing 8 methods to improve it. From the introduction, I’ve already learned some new information that nearly one in two people leave a website after visiting just one page, a poor site architecture guaranteeing a goodbye from users downgrading the business value.

So basically, a website architecture is the hierarchical structure of website pages, the structure is reflected through internal linking. A typical website structure looks like a rooted tree graph, in which the home page is the root. Subpages from Homepage are branches, and from there, additional pages are developed. Website structure is important as it strengthens the UX (user experience) and SEO (search engine optimization), meaning that if users spend more time on your web, your search ranking will level up as well.

Down here is the list of eight methods that they pointed out to improve the web architecture:

  1. Create a simple top-level navigation menu: Every item should deliver the content according to it
  2. Keep your URLs simple and user-friendly: For example, amazon.com
  3. Model your website architecture after the top players in your industry
  4. Keep your website consistent
  5. Implement the pillar-cluster internal linking model: Child pages are linked to each other
  6. Provide access to most of your website’s pages in 3-4 clicks
  7. Use breadcrumbs: A button that allow users to always be able to go back to your homepage
  8. Create an HTML and XML sitemap: A document that lists out all of crawlable pages on your web

The idea is telling the developers to keep everything simple and users are able to navigate anywhere they want in a convenient way. To illustrate, we all know that Amazon is the biggest ecommerce platform with an outstanding graphical user interface that allow users to look for what they want. In this circumstance, Amazon is the pioneer that affect almost every other site to build somewhat familiar, as well as the web architecture.

To sum up, with the duration of 6 minutes, this blog demonstrated the basic concept of website architecture. Since we will later learn about web architecture, it’s a good read in term of preparation.

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

Dodging the Dangers of Docker

Greetings fellow programmers. Tonight I am pleased to write a rather useful blog, and one that has been “whipped up fresh” (meaning that I wrote the post rather quickly, and in one take). Anyways, onto the material!

As seen in class, it seems as though many of us (especially those who use Windows OS computers) have had trouble installing the “Docker” container program used for our homework. While I cannot guarantee this to be a “foolproof guide” that completely saves the day, hopefully it will provide some pointers and lead those who still struggle with its installation in the right direction.

Helpful hints for installing Docker (on Windows) include:

  1. Enabling “Virtualization” on your task manager “CPU”. It is usually enabled by default, but can be enabled (if disabled) at the BIOS settings screen.
  2. Installing Windows 10 Pro, Education, or some variant other than “Home”. Windows 10 Home will not work (for some reason). Windows 10 Education can be acquired for free from the WSU IT website with verification of a student ID.
  3. Enabling features such as “Hyper-V”. This task gets a bit more complicated; it involves going to the control panel.
An image to provide a visual aid for Tip #1. Please excuse the sloppily made encapsulation of “Virtualization”.

So, why did I post these tips, and especially so late after nearly everyone has already set up the software? To start, I don’t believe that everyone has the software set up, and even those who do may still experience some issues (such as myself). These tips, by the way, were derived from an article linked below (“How to Install Docker on Windows 10” by Harshal Bondre); said article can also be referenced in YouTube videos, class instructions, and other resources.

Personally, I chose this article for two reasons. First, I enjoy helping people, as mentioned in my introduction. I don’t want to see people having to go through the same struggles that I did when learning this material; nothing makes me happier than seeing someone else solve in 5 minutes a problem that took me 5 hours. Second, I firmly believe that maximum proficiency of a material is achieved when someone has the ability to teach it to someone else. If I am able to instruct others on how to install Docker, then it means that I know it by heart. I don’t just know the material so well that I answer questions right, I know it so well that I cannot answer them wrong.

As a student that enjoys helping others (and is aspiring to be a tutor, TA, or other form of future faculty), I may consider using the materials learned here to create a guide to setting up Docker. Alongside some colleagues, we can ensure that the Fall of 2021 will be the last time that any student has this much trouble installing essential class software.

From the blog CS@Worcester – mpekim.code by Mike Morley (mpekim) and used with permission of the author. All other rights reserved by the author.

Software Construction Log #1 – Visualizing Software Design and Modeling through Class Diagrams

            So far in my Software Development courses, the programming assignments I was tasked to work on have been either partially coded or straightforward enough for myself and other students to work on without much of a need of extensive planning beforehand. However, this is not the case when a programming project’s scope expands as the functionalities such project is expected to perform increases in complexity. At this point, simply getting head-first into programming features without at least a basic understanding on how features should interact with one another will do more harm to this project in the long run than save time in the short run.

            Before beginning development, it is important to create schematics for the project in order to properly convey how any components interact with one another and possibly optimize such interactions prior to development, as well as have solid and understandable documentation for the project after development. Recently, I was introduced to Unified Modeling Language (UML) and the class diagrams that can be created using this language and can be used for object-oriented development. For this post, I want to focus specifically on the concept of class diagrams overall instead of how they can be created with the use of UML-based tools.

            As I was researching resources on the topic of class diagrams, I came across the materials listed at the end of this post, though I will mostly focus on this one tutorial post titled UML Class Diagram Tutorial: Abstract Class with Examples on Guru99.Com. Although there exists extensive documentation regarding UML modeling and class diagrams, this article by Alyssa Walker introduces and defines the basic concepts of UML Class diagrams, as well as the types of relations between classes such as Dependency, Generalization, and Association, as well as outline the best practices for designing class diagrams. Though I was introduced to class diagrams conceptually while I was enrolled in a Databases course, I am now able to understand how the concepts used in such diagrams can transfer from database design to software design, specifically the concepts of Association and Multiplicity.  

           Moreover, by examining the class diagrams provided in the article, I can understand better why it is important to literally visualize the interactions between classes, especially when it comes to developing software in object-oriented languages; by seeing how the classes implemented will interact with each other, as well as how the features I wish to implement will add complexity to the project overall. Therefore, any factor that contributes to increasing complexity in a project in any capacity can be properly taken care of well in advance without sacrificing additional development time in the long run, as well as provide important documentation that can contribute in the maintenance of the project after development.

Direct link to the resource referenced in the post: https://www.guru99.com/uml-class-diagram.html

Recommended materials/resources reviewed related to class diagrams:
1) https://developer.ibm.com/articles/the-class-diagram/
2) https://www.microtool.de/en/knowledge-base/what-is-a-class-diagram/
3) https://www.ibm.com/docs/en/rsm/7.5.0?topic=structure-class-diagrams
4) https://www.bluescape.com/blog/uml-diagrams-everything-you-need-to-know-to-improve-team-collaboration/

From the blog CS@Worcester – CompSci Log by sohoda and used with permission of the author. All other rights reserved by the author.

Self-Directed Professional Development Post #3

For this week’s blog post, I’ve decided to learn more about API documentation. I found a YouTube video titled, “Get an overview of the Java API documentation and how to use it” in order to do this. The reason I picked this topic is because as I create and design programs/software, I will likely be referencing Java API documentation. Therefore it is important that I understand and know how to navigate this information. 

One of the first things this tutorial taught me is that the documentation I will be using will be under Java SE and not Java JDK. The speaker of this tutorial, Steve Perry, did not go too in depth into what Java JDK is so I ended up doing some additional research to learn more about JDK. JDK stands for Java Development Kit and it is a platform released  by Oracle Corporation to develop Java applications. Although this may seem like a trivial thing to learn, I appreciated learning more Java/programming jargon.

After explaining that the different classes in API documentation are grouped by modules, Steve selects the java.base module to walk through because of how commonly used it is. In modules, there are packages which are a group of related classes. The first package Steve introduces and reviews is the java.lang, which contains classes that are fundamental to the Java language. He explains that each package starts out with a description of the package, followed by its interface, classes, enumerations, exceptions, and errors. Steve also refers to the documentation of this particular class as a javadoc which is something I’ve heard before but now know exactly what it refers to. 

Steve then selects the String class, again, because of how commonly used it is. We then learn how to access String’s constructors and methods. Steve shows us how clicking on a method gives you more details, such as a method’s description, parameters, return values, etc. The last useful bit of information I learned from this video was how to access the information for classes if I don’t know what module or package they may be in. I can do this by using the index or clicking on the top left section titled, “All Classes” in order to do so.

Overall, I considered this to be a very worthwhile use of my time because API documentation is something I often get redirected to when I have a question about a particular class I’m using. However, since API documentation contains so much information, I often get overwhelmed and lost in all the classes and information available for a particular class. Because of this blog post and this tutorial, I was able to learn the organizational scheme for API documentation in a way that I will remember. Although it may seem like a small step, it’s a step that makes me a little more confident as a java programmer.

Tutorial link: https://www.youtube.com/watch?v=ULEOb8wLa_k

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

What is an API?

From my other posts, I mentioned APIs quite a few times. But what exactly are they? API’s also known as Application Programming Interface, is a software that allows different applications to connect to each other. Some examples that we see all the time could be when you’re sending a message on a social media platform, using a program, or just checking things on your phone. Doing any of these activities, you’re using an API.

An API works to communication data to different applications. When one is using an application, the application would connect to the internet and send data over to a server. Once the data is retrieved from the server, it then gets interpreted and will perform the necessary actions to send the data back to the application. From here the application will take the data it received and interpret and present the data requested in a way it is readable. This is what an API do. Not only does APIs act like a way for different applications to send and retrieve data, but it also acts like a layer of security. When using any type of application, your phone’s data is never fully exposed to a server its retrieving data from, same goes for the server. This is because instead of sharing every bit of information, only small packets of information are being shared or what is ‘necessary’.

A more in depth example I found while researching this topic is to imagine you’re sitting at a t able in a restaurant with a menu to order from. In the restaurant, the kitchen is a part of the system that will make your order. However how the kitchen is missing the details for what you ordered. In order to receive the order, they must communicate with the server. This is the API. The server communicates to the kitchen with your order in order to make it for you. This is basically what an API does. It connects two applications, so they can connect with each other and deliver the data.

The reason why I chose to write about API is because we will be learning it in class. Not only that but from my previous posts, I have talked about my interest in becoming a full stacked developer. This means I will have to proficient knowledge in both front and backend development. API is used in both. APIs are important to know because it will help me when I decided to create my own application as well, so it is very crucial I know how API’s work.

A post I would recommend to read about API is:
https://www.mulesoft.com/resources/api/what-is-an-api.
Not only does it describe what APIs do, but gives examples and has other links that teaches you more about APIs.

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

Analyzing Code Smells

This week, the topic that I wanted to focus on was design smells. I wasn’t confident in my own knowledge of what exactly design smells were or how to implement that knowledge into my designing of code. So I found a blog post by Sandor Dargo, in which he reviews the book Refactoring for Software Design Smells. Dargo’s blog has a background in software-design related book reviews, so it seemed like a good place to learn a little more about what design smells were.

The review covers a lot of the fundamentals of design smells, much like what we did in class, although it focuses more on what design smells affects within software design, such as understandability and reliability. I really liked this way of thinking about design smells, as simply learning them felt a lot more abstract to me, but showing what it affects and how it can harm the design of software makes it a little bit more understandable, to me at least. The first half of the post talks about the concept of technical debt, and the later half is more on the design smells. Obviously these both impact each other, but I liked his breakdown of technical debt as being similar to taking out a loan to get something done that needs to be done, but if you don’t keep up with that debt you will get further and further into debt until you fail. I think it is a very good analogy to technical debt, and aided in my understanding of the topic as a whole. The final part of the post focuses on common issues that are caused by design smells and how these seemingly insignificant things can make your code less and less usable over time.

I found this review to be extremely useful in my understanding of what design smells are and why code refactoring is so important. The most important aspect of this post to me was the discussion on technical debt. It is such an important aspect of software design to consider, as is allows us to make quick-and-dirty solutions when we need to, but also tells us how important it is to go back and change the code before it gets out of hand. We must design code in a way to make it as easy to use as possible, and easy to build on in the future. If we are able to properly document our code, allow for reusability within the system, and make use of abstraction and encapsulation to make code as simple to follow as possible, we can create an environment that can significantly increase not just our own workflow, but the workflow of any collaborators, or anyone who needs to make use of our code. It is our job as designers to make sure that as time goes on, our code gets easier to work with, especially as complexity increases to meet the demands of our clients.


Source:

https://www.sandordargo.com/blog/2021/01/30/refactoring-for-software-design-smells

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

UML Diagrams

Diagrams are usually a good way to convey an idea. There is an intrinsic human ability to understand abstract instructions in this form. It is not surprising that in designing software we would look for a way to express it as such. UML diagrams are not only helpful as a [mockup]blue_print in designing but also as format to present the main idea in a more straight-forward way to non-tech assets.

I find it interesting the idea of facilitating the introduction of a concept to a non-tech asset (perhaps because most of the time I just want to understand it better myself). I should really explain what I mean by a non-tech asset, this term could be used somewhere else for a different purpose –if you do so know a better word for my definition, please leave a message. I think of non-tech assets as a broad spectrum of individuals that may be involved directly or indirectly to the end-product. There also may be closer relations amongst different expertise that makes part of a certain project alien to a particular group –also tech aware but not omniscient. This is my philosophical attempt at saying some people need to understand how something works not necessarily why it works –this tie well with obfuscation I believe.

So, by the definition given above and by the readings this week it becomes clearer that there is a choice to be made in UML diagrams –should it be all-expressive or partially-expressive? I believe that most tend to stay at the partially-expressive end, which is best because it uses obfuscation to increase clarity. I know this sounds counter to obfuscation but think, a lot of information about something you don’t understand, or care, does not necessarily make things clear. It does the opposite; it muddies the intention; it hides the meaning by overloading the target. Now that we cover this, let’s move to decision making and end with standardization.     

Throughout the last classes (school class) we have been discussing how to optimize code by looking at UML diagrams. The information on the diagram provided us with the information necessary to see the problems accrued by the code’s configuration. So, it is safe to say that there is a minimum amount of information that needs to be in a diagram in order to be fully helpful. It is also a safe bet to say that a lot of the implementations that don’t affect the relationship amongst the classes (not school classes) is too much information. I think that if we code clean (no pun intended) the implementation speaks for itself and it doesn’t need diagram representation, which should only be necessary when we look at many classes interacting.

At the reading we were presented with a very interesting standardization problem. From what I saw there are a lot of ways to use UML for a variety of subjects. There was a discussion about a public (tech public) uproar from a previous attempt to standardize. I think the complexity lies in how many ways these diagrams are used. Maybe software developers would benefit from such standardization but who am I to say. As far as I know if I had to work with a team, I would like them to produce diagrams that follow a particular set of rules instead of looking at a jungle of too much and too little. Fowler says it best in this quote “… there is no hard-and-fast correspondence between the UML and code, yet there is a similarity. Within a project team, team conventions will lead to a closer correspondence” (Fowler, 2004).

References

Fowler, M., 2004. UML distilled Pearson Education, inc.

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