Vyoms OneStopTesting.com - Testing EBooks, Tutorials, Articles, Jobs, Training Institutes etc.
OneStopGate.com - Gate EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopMBA.com - MBA EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopIAS.com - IAS EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopSAP.com - SAP EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
OneStopGRE.com - of GRE EBooks, Tutorials, Articles, FAQs, Jobs, Training Institutes etc.
Bookmark and Share Rss Feeds

What Are Philosophy-Based Design Patterns? | Articles | Recent Articles | News Article | Interesting Articles | Technology Articles | Articles On Education | Articles On Corporate | Company Articles | College Articles | Articles on Recession
Sponsored Ads
Hot Jobs
Fresher Jobs
Experienced Jobs
Government Jobs
Walkin Jobs
Placement Section
Company Profiles
Interview Questions
Placement Papers
Resources @ VYOMS
Companies In India
Consultants In India
Colleges In India
Exams In India
Latest Results
Notifications In India
Call Centers In India
Training Institutes In India
Job Communities In India
Courses In India
Jobs by Keyskills
Jobs by Functional Areas
Learn @ VYOMS
GATE Preparation
GRE Preparation
GMAT Preparation
IAS Preparation
SAP Preparation
Testing Preparation
MBA Preparation
News @ VYOMS
Freshers News
Job Articles
Latest News
India News Network
Interview Ebook
Get 30,000+ Interview Questions & Answers in an eBook.
Interview Success Kit - Get Success in Job Interviews
  • 30,000+ Interview Questions
  • Most Questions Answered
  • 5 FREE Bonuses
  • Free Upgrades

VYOMS TOP EMPLOYERS

Wipro Technologies
Tata Consultancy Services
Accenture
IBM
Satyam
Genpact
Cognizant Technologies

Home » Articles » What Are Philosophy-Based Design Patterns?

What Are Philosophy-Based Design Patterns?








Article Posted On Date : Wednesday, March 21, 2012


What Are Philosophy-Based Design Patterns?
Advertisements

Is studying philosophy academic? After all, we don't go anywhere by studying it. (See Sidebar 1. Classical Philosophy vs. Analytic Philosophy for a full discussion of philosophy's limitations.) I think that the answer is no, especially if you are a software engineer. A great deal of a software engineering is about analyzing a portion of the real world and trying to "copy" that reality into a software system. What could be a richer source for ideas about reality analysis than philosophy? We may not expect philosophy to actually solve the big questions of life, but we surely can expect to get ideas from philosophy about new ways of viewing and exploring reality (ideas that can help us solve our own software design issues). After all, some of the greatest minds ever have contributed to this huge collection of ideas called philosophy.


In fact, any current software design concept -- deliberately or not -- leans on solid philosophical foundations. For example, one of the most fundamental ideas of Object-Oriented Programming (OOP) is the idea of instantiation. Instantiation means that the nature of any runtime element (object, instance, etc.), which is actually a segment of memory that carries a detailed description of an actual, real-world entity, was captured and defined in an abstract element. This element is the class, an immutable entity (as long as the software is in a runtime state) that exists only in a separate abstract sphere, which is actually the code itself (a collection of English-like language words). The similarities between this fundamental OOP principle and Plato's Theory of Forms are clear. The Forms Theory argues that:

    There exists a world of abstracts or forms, completely independent from the empirical, real world.
    Each form is composed of a certain collection of properties (for example, "type of fabric" is a property of "garment").
    In parallel to the forms' abstract world, an empirical world exists: the world we experience with our senses.
    The empirical world contains concrete objects, where each concrete object is derived from one of the parallel abstract world's forms.

The idea of Philosophy-Based Design Patterns presented in this article contends that current software design's philosophical origins must be challenged from time to time (especially in cases where our current view of reality doesn't provide us with a sufficient software design solution), and that old foundations must be replaced with new ones.

The structure of a Philosophy-Based Design Pattern goes like this:

    Purpose -- a short description of the kind of design problems that the Philosophy-Based Pattern should handle
    Motivation -- the motivation definition, based on an example of a software design problem
    Philosophical Background -- a brief discussion about some of the insights that the world of philosophy has gained regarding the problem at stake
    Current Philosophy-Based Pattern -- a description of the philosophical idea that functions as a model for how things are done today
    Suggested Philosophy-Based Pattern -- a pattern suggesting an alternative philosophical idea to become, in certain cases, the model for design solutions
    Implementation Example -- a demonstration of an implementation of the suggested Philosophy-Based Pattern

Following is an example of such a philosophy-based pattern that relates to the way object instantiation might look. Find other philosophy-based patterns at philosoftware.com.
Philosophy-Based Design Pattern: Inhibition Pattern

To better understand Philosophy-Based Design Patterns, consider the Inhibition Pattern.
Purpose

The purpose of this design pattern is to enable inhibition of inherited properties and methods that do not exist in the successor object.
Motivation

One of the most prominent features of the object model (taxonomy of objects or classes that reflect the real-world entities that are relevant to a given application) is the fact that there is a direct relationship between the degree of complexity of an object and its depth within the tree. That is, as we descend the object model from its root toward its leaves -- or in other words, as we move through the taxonomy from the abstract toward the concrete -- we will encounter objects that have more public/protected properties and more public/protected methods.

This phenomenon is the outcome the object-oriented model's defining the relations between abstract and concrete objects on Inheritance. However, we always have the option to add to the concrete object properties and behavior that won't exist in the context of its abstract base object. The opposite action -- adding to the abstract object public/protected properties or behavior that won't exist in the context of the concrete successor -- is impossible, because all public/protected properties and behavior are inherited.


Just to exemplify this issue, let's take a look at the Object class, which serves as the root object of the .NET Framework object model. It contains very little information and very few highly generic functions, such as ToString() or Equals(). However, the Button class, located somewhere in the lower, more concrete part of the .NET taxonomy, contains many features and functions, some of which were inherited from the long branch of its ancestors (including the Object class), and some others which are unique.

Another element that characterizes the object model is the existence of split junctions. Each such junction splits the taxonomy into two or more different branches of classes, which share the same base classes but completely differ from each other from the point of the split junction and further. An example of such a split junction could be a class that functions as a base class for all GUI classes (GUIObject). From that point, the hierarchy is separated into the following:

    GUIPrimitive is the base class of all the GUI objects that are used for real interaction with the user (information display or information acceptance), such as Button or TreeView.
    GUIContainer is the basis for the GUI objects that are used as envelopes (containing other GUIContainers and of course GUIPrimitives), such as a Panel or GroupBox.

Combining the two mentioned characteristics of the object model reveals the following picture -- as we descend the object model, we will notice the following phenomena:

    The level of object complexity increases.
    We will probably encounter junctions, which split the taxonomy into two or more class hierarchies, which have a completely identical "tail" and completely different "head."


We may ask ourselves whether an object model that "behaves" as described will always fit our needs as software engineers, which is to reflect reality in the most precise and efficient way.
Inhibition Pattern Use Case

Suppose that we want to build a drawing application that allows the addition of various graphical objects to a canvas and allows editing of various parameters of those objects such as location, size, color and so on. A quick analysis of the shapes reveals that polylines, rectangles and triangles share some properties that do not exist in circles. For example, they all have a set of straight lines defining their outline. Therefore, presumably, when we define the object model for this application, a new class may well be built that expresses the differentiation between forms that are defined by a set of edges and those that aren't. We may call this new class ShapeWithEdges. Figure 3 shows the enhanced object model.




The root class is the class Shape, which contains the basic elements of the shape (for example, the function Draw). The Shape class is inherited by the ShapeWithEdges and the Circle classes, which in turn will add their own new properties and behavior (for example, list of Edges, which will be added to ShapeWithEdges, and the Radius, which will be added to the Circle).

Alternatively, we might want to define the shape's fill descriptor for shapes that are occupying space. A class named Fill that incorporates relevant information such as color fill, gradient and texture probably will satisfy our needs, but the question is which class from the said object model should contain this Fill object. It does not belong to the Shape class, as this property is foreign to the Polyline class, so we probably should add a new class: ShapeWithFill. Like the ShapeWithEdges class in the preceding example, ShapeWithFill expresses the differentiation between the shapes that could be filled and those that couldn't



But what about a situation where we want to express these two properties in the same object model? Apparently, we have to duplicate one of the expansion dimensions. For example, we can add a Fill object to the classes that should have it (Circle, Rectangle, Triangle) -- Example 1.



Alternatively, we can add a list of Edges to the classes that should have this list (Polyline, Rectangle, Triangle) -- Example 2.




Both new models increase the level of complexity for maintaining the model, so we may want to look for a slightly different way to build a model, a way that will allow us to overcome this aforementioned problem.






Sponsored Ads



Interview Questions
HR Interview Questions
Testing Interview Questions
SAP Interview Questions
Business Intelligence Interview Questions
Call Center Interview Questions

Databases

Clipper Interview Questions
DBA Interview Questions
Firebird Interview Questions
Hierarchical Interview Questions
Informix Interview Questions
Microsoft Access Interview Questions
MS SqlServer Interview Questions
MYSQL Interview Questions
Network Interview Questions
Object Relational Interview Questions
PL/SQL Interview Questions
PostgreSQL Interview Questions
Progress Interview Questions
Relational Interview Questions
SQL Interview Questions
SQL Server Interview Questions
Stored Procedures Interview Questions
Sybase Interview Questions
Teradata Interview Questions

Microsof Technologies

.Net Database Interview Questions
.Net Deployement Interview Questions
ADO.NET Interview Questions
ADO.NET 2.0 Interview Questions
Architecture Interview Questions
ASP Interview Questions
ASP.NET Interview Questions
ASP.NET 2.0 Interview Questions
C# Interview Questions
Csharp Interview Questions
DataGrid Interview Questions
DotNet Interview Questions
Microsoft Basics Interview Questions
Microsoft.NET Interview Questions
Microsoft.NET 2.0 Interview Questions
Share Point Interview Questions
Silverlight Interview Questions
VB.NET Interview Questions
VC++ Interview Questions
Visual Basic Interview Questions

Java / J2EE

Applet Interview Questions
Core Java Interview Questions
Eclipse Interview Questions
EJB Interview Questions
Hibernate Interview Questions
J2ME Interview Questions
J2SE Interview Questions
Java Interview Questions
Java Beans Interview Questions
Java Patterns Interview Questions
Java Security Interview Questions
Java Swing Interview Questions
JBOSS Interview Questions
JDBC Interview Questions
JMS Interview Questions
JSF Interview Questions
JSP Interview Questions
RMI Interview Questions
Servlet Interview Questions
Socket Programming Interview Questions
Springs Interview Questions
Struts Interview Questions
Web Sphere Interview Questions

Programming Languages

C Interview Questions
C++ Interview Questions
CGI Interview Questions
Delphi Interview Questions
Fortran Interview Questions
ILU Interview Questions
LISP Interview Questions
Pascal Interview Questions
Perl Interview Questions
PHP Interview Questions
Ruby Interview Questions
Signature Interview Questions
UML Interview Questions
VBA Interview Questions
Windows Interview Questions
Mainframe Interview Questions


Copyright © 2001-2024 Vyoms.com. All Rights Reserved. Home | About Us | Advertise With Vyoms.com | Jobs | Contact Us | Feedback | Link to Us | Privacy Policy | Terms & Conditions
Placement Papers | Get Your Free Website | IAS Preparation | C++ Interview Questions | C Interview Questions | Report a Bug | Romantic Shayari | CAT 2024

Fresher Jobs | Experienced Jobs | Government Jobs | Walkin Jobs | Company Profiles | Interview Questions | Placement Papers | Companies In India | Consultants In India | Colleges In India | Exams In India | Latest Results | Notifications In India | Call Centers In India | Training Institutes In India | Job Communities In India | Courses In India | Jobs by Keyskills | Jobs by Functional Areas

Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes

Gate Articles | Gate Books | Gate Colleges | Gate Downloads | Gate Faqs | Gate Jobs | Gate News | Gate Sample Papers | Gate Training Institutes

MBA Articles | MBA Books | MBA Case Studies | MBA Business Schools | MBA Current Affairs | MBA Downloads | MBA Events | MBA Notifications | MBA FAQs | MBA Jobs
MBA Job Consultants | MBA News | MBA Results | MBA Courses | MBA Sample Papers | MBA Interview Questions | MBA Training Institutes

GRE Articles | GRE Books | GRE Colleges | GRE Downloads | GRE Events | GRE FAQs | GRE News | GRE Training Institutes | GRE Sample Papers

IAS Articles | IAS Books | IAS Current Affairs | IAS Downloads | IAS Events | IAS FAQs | IAS News | IAS Notifications | IAS UPSC Jobs | IAS Previous Question Papers
IAS Results | IAS Sample Papers | IAS Interview Questions | IAS Training Institutes | IAS Toppers Interview

SAP Articles | SAP Books | SAP Certifications | SAP Companies | SAP Study Materials | SAP Events | SAP FAQs | SAP Jobs | SAP Job Consultants
SAP Links | SAP News | SAP Sample Papers | SAP Interview Questions | SAP Training Institutes |


Copyright ©2001-2024 Vyoms.com, All Rights Reserved.
Disclaimer: VYOMS.com has taken all reasonable steps to ensure that information on this site is authentic. Applicants are advised to research bonafides of advertisers independently. VYOMS.com shall not have any responsibility in this regard.