News Feed
Jobs Feed
Sections




News Archive
feed this:

Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

thePHP.cc:
Software Development Fluxx
February 15, 2013 @ 09:06:57

If you've ever played the card game "Fluxx" (or are familiar with the ever changing rules behind software development) you can release to this new article from Sebastian Bergmann. He makes a link between the "Star Fluxx" card game and how OOP and encapsulation help make changing things easier.

Star Fluxx is a science-fiction-themed version of Fluxx, "a card game [that] is different from most other card games, in that the rules and the conditions for winning are altered throughout the game, via cards played by the players." (Wikipedia) When I heard the description of the game on the aforementioned episode of TableTop it reminded me of software development projects. Changing business rules and requirements (rules and the conditions for winning), probably sounds familiar to you, too.

He talks about how the game could be implemented effectively in OOP classes and interfaces - and how this structure would make it easier to make changes. A largely procedural codebase, however, would make the task much more challenging. The analogy breaks down a bit when it gets to the competitive nature of the game and how software development should be collaborative instead, but it's still effective.

0 comments voice your opinion now!
fluxx software development game testing oop encapsulation


PHPMaster.com:
Practical Code Refactoring, Part 3 - Extensibility
October 25, 2012 @ 09:22:05

PHPMaster.com has posted the third part in their "Practical Code Refactoring" series - this time with a focus on Extensibility. (Part 1, Part 2).

Extensible code is a piece of code which follows re-usable, logical, well-known patterns, be it standard design patterns, or normal logical flow. Modular code tends to be highly extensible and monolithic code tends to be non-extensible, but monolithic code might be more efficient, so to solve this conundrum some practices allow developing in a modular way and deploying in a monolithic way so we can get the best of both worlds. The major aspects which we are to discuss with regard to extensible code are: logical extensibility (normal logical flow and design patterns), modular design, and decoupling and encapsulation.

He goes through each of the sections - logical extensibility, modular design and decoupling/encapsulation - and for each provides some questions to ask to help you whip your code into shape.

0 comments voice your opinion now!
code refactor extensibility series decoupling encapsulation modular


Wes Shell's Blog:
Encapsulation in PHP
October 13, 2009 @ 09:05:16

Wes Shell has posted a new tutorial to his blog today looking at encapsulation in PHP development - containing parts of the script to make them easier to work with as a whole.

In order to understand the purpose of encapsulation you first need to understand the purpose of classes. [...] In order for them to be used properly as they were designed, you will need to limit how users of the class can interact with those characteristics and functionality.

He looks at the visibility modifiers (public/private/protected), interface functions and some sample code showing how to use them in a simple class to work with a Person's set of data.

1 comment voice your opinion now!
tutorial encapsulation visibility


Blue Parabola Blog:
Objectively Oriented
February 18, 2009 @ 09:31:30

On the Blue Parabola blog, Matthew Turland takes a look at object-oriented programming and what core concepts lie at its heart.

What is object-oriented programming? The acronym OOP has become a bit of a buzzword in the current age of programming, to the point where the waters of its definition have become rather murky. [...] PHP may not be object-oriented, but from a purist perspective, neither is Java. What do I mean by "purist perspective?" Plain and simple: everything is either an object or a message being passed between objects (where message parameters are also objects).

He mentions one of the first languages to support objects (Simula) and the four fundamental concepts that would make a language truly OOP - abstraction, inheritance, encapsulation, polymorphism. Its his opinion, though, that while its good for languages to adhere to these four principles as much as they can, discussions about how well they adhere to them is usually just "spinning your wheels" and don't have much use.

0 comments voice your opinion now!
object oriented definition abstraction inheritance encapsulation ploymorphism


Alex Netkachov's Blog:
Are setters evil?
June 17, 2008 @ 09:36:03

Alex Netkachov has posted his own response to this opinion on the Typical Programmer on getters and setters in object-oriented applications.

"Do not use getters and setters" looks like a hastily advise, but its meaning is very important and it is "do not break encapsulation", which moves us to the question what the encapsulation is.

He notes that encapsulation is, in essence, hiding parts of the code away so that the user/other coders only see a little bit of the magic that happens. He argues that getters and setters are a valid part of the encapsulation process and that designing a good, easy to use system almost requires them.

0 comments voice your opinion now!
setter getter object oriented programming encapsulation


Typical Programmer Blog:
Doing it wrong getters and setters
June 16, 2008 @ 11:19:17

According to this new post on the Typical Programmer blog, using getters and setters in your scripts only adds in a bit of unnecessary coupling and complexity to your scripts that you just don't need.

Today most of the popular programming languages support objects, limiting scope, modularity, passing by value, and sophisticated built-in types. There should be no reason to deliberately expose an object's data to the rest of the code because the language can enforce encapsulation and data hiding.

While not specific to PHP, the post does recommend against them because of one simple reason common to all languages that make them possible - they "break the encapsulation OOP offers". For them, they're like a cheat to get around bad coding practices and are not needed to make a successful application work.

0 comments voice your opinion now!
getter setter break object oriented encapsulation scope bad



Community Events











Don't see your event here?
Let us know!


release package series security opinion unittest facebook component framework performance symfony2 hhvm podcast install application database composer language introduction hack

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework