“The more abstract the truth you wish to teach, the more you must allure the senses to it.” - Friedrich Nietzsche
Seeing the big picture is often the toughest to figure out when learning something new. Why? Because the big picture offers abstract thinking that simplifies every complex idea and concepts that many people tend to complicate. Abstraction is formed “by reducing the information content of a concept or an observable phenomenon, typically to retain only the information which is relevant for a particular purpose”.
In computer science, abstraction is the process of separating ideas into its own instances or functions to simplify its use cases. Its solution is to evaluate the details that are constantly used by multiple methods and instead of rewriting that part over and over again, that particular detail can be removed and put into its own method. With that separation, whenever a new feature wants to use that function, it can easily be called by its function name with its associated parameters or conditions instead of coding it entirely again.
With this approach, abstraction offers code optimization to lessen the size of the program, code reuse as well as make it maintainable. Why? Because if we want to extend or improve only that part of the functionality in the future, all we need is to change that method and it gets applied to the other parts directly.
Abstraction In Web Development
To clarify, there may be a website project with different sections such as events, exhibits, profiles, blogs, news, store and games. What if you suddenly requests to add videos or photos for all those areas?
Some may think that the video can be embedded in the page manually. However, doing that will be troublesome to maintain the videos in the long run. What if there are multiple sections that one video can be part of? Or what if there are multiple videos that belong to different areas. It is wasteful to embed the same code over and over again. Why? Because doing so results to clutter since the layouts of each section may be different and the placement of the videos become inconsistent.
The best and simplest solution is to create a new content type called Video and that references the page it belongs to. The Video type can be extended to include multiple videos linking to the same page or to multiple pages. As you can see, this allows flexibility in growing and managing the contents. The videos can also be placed into its own section such as a Gallery of Videos to include search filters while still attached to different parts of the website.
How is this related to abstraction? The same concept of using references can be applied to any sections, not just video. Here, we can use the variable X for Video. X is connected through reference pointing to A (event), B (exhibit), or C (news). Therefore, the connections are dependent on how the business owner organizes their thoughts, activities and everyday matters of their business.
What Are Constructors?
To determine the best combinations of connections, the developer needs to know the values for the constructors. Constructors are applied to initialize variables and create an object. From the previous example, the object that is created is a Video. However, each Video may have different values and traits depending on which constructor is used.
Constructor overloading is when constructors have the same name, but have different resulting type depending on the parameters or conditions given to it. This concept is also called polymorphism or the ability for one instance to change and transform itself depending on its conditions. In terms of business, the conditions are determined by the business owner and/or managers of the website. Once those variables are clear, the web developer begins to create a functional website that is flexible, scalable and simple to maintain.
Ultimately, every component of a website relies heavily on the information identified by the business owner. No two businesses are alike since the Founders all have their own unique way of doing and organizing things. The more customized a website is made for your business, the more straightforward the flow of adding new contents. Why? The flow comes directly from your own thought process. A web developer’s purpose is to simplify your thought process and implements it logically onto your website.
From understanding abstraction, do you have a clearer definition of your business’s variables and what those conditions should be? What is the best way to reflect your business’s aspirations and turn it into a practical website?