Skip to main content

Posts

Showing posts with the label OOPS

Extending Object Oriented Programming concepts further with abstraction and interfaces

Few days back I wrote for Solid and Grasp principles for oops http://www.developerscloud.org/2014/08/oops-beyond-four-pillars-solid-and-grasp.html . Now I am again extending it to make it more matured way to write code. Let start with coupling and cohesion. Loose/Low Coupling low dependency between classes; low impact in a class of changes in other classes high reuse potential High Cohesion measure of how strongly-related or focused the responsibilities of a single module are If methods of a class tend to be similar in many aspects, then the class have high cohesion In highly-cohesive system, code readability and the likelihood of reuse is increased, while complexity is kept manageable. Also check Encapsulate what varies Favor Composition over Inheritance Program to interface not implementation Strive for loosely coupled design between objects that interact For Interfaces Like an abstract base class: any non-abstract type inhe...

OOPs beyond the Four Pillars - SOLID and GRASP

As we know  Object oriented programming is a type of programming paradigm based around programming  classes  and instances of classes called  objects . These can be objects that appear on the screen (e.g., pictures, textboxes, etc.) or are part of the programming (e.g. actors, connections, particles, etc as mentioned in my post  http://www.developerscloud.org/2013/02/what-is-oop-basic-concepts.html   written ages ago. Here we are going to extend the oops beyond its four pillars i.e. Abstraction Encapsulation Polymorphism  and Interfaces i.e.  Inheritance So first we will go through  SOLID and then GRASP SOLID Principles are principles of class design. • S RP: Single Responsibility Principle – An object should have only a single responsibility & all the responsibility should be entirely encapsulated by the class. – There should never be more than one reason for a class to change • O CP: Open/Closed Principle ...

What is OOP ? Basic Concepts.

What is OOP? Object oriented programming is a type of programming paradigm based around programming classes and instances of classes called objects. These can be objects that appear on the screen (e.g., pictures, textboxes, etc.) or are part of the programming (e.g. actors, connections, particles, etc.) What is an Object? An object is merely a collection of related information and functionality. An object can be something that has a corresponding real-world manifestation (such as an employee object), something that has some virtual meaning (such as a window on the screen), or just some convenient abstraction within a program (a list of work to be done, for example). An object is composed of the data that describes the object and the operations that can be performed on the object. Information stored in an employee object, for example, might be various identification information (name, address), work information (job title, salary), and so on. The operations performed might include...

Three Tier Architecture : A simple Example/Illustration

Three Tier Architecture: Very Easy to understand, the three tier are: 1. Presentation layer 2. Business Layer 3. Database Layer Simple Example: Lets take example of a Songs and Artist. 1. DataAccess Layer Below is a class of Data Access Layer, that has some dummy/fudge data, we only write DataBase calling method in DataAccessLayer. using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace DataBaseLayer {     public class DataAccessLayer     {         string [] ArtistName = { "Akon" , "Shakira" , "Michael_Jackson" };         string [] Shakira = { "Waka Waka" , "Addicted to you" , "Beautiful Liar" };         string [] Akon = { "Chammak Challo" , "Lonely" , "Dont Matter" };         string [] Michael_Jackson = { "Beat It" , "Danger...

What is Software Architecture?

When you build your house, you would never think about building it without an architect, correct? However, many medium to large size software projects are build without a software architect. That seems kind of scary, and you might wonder why? Well, the role of the software architect has neither been widely understood, nor his necessity been acknowledged. Even to date there is still no agreement on the precise definition of the term “software architecture”. Matthew R. McBride writes, "a software architect is a technically competent system-level thinker, guiding planned and efficient design processes to bring a system into existence. He is viewed by customers and developers alike as a technical expert. The architect is the author of the solution, accountable for its success or failure." The term software architecture also refers to documentation of a system's software architecture. Documenting software architecture facilitates communication between stakeholders, documen...