News Feed
Sections




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

Jani Hartikainen's Blog:
Exceptions and abstraction
August 16, 2010 @ 09:59:45

Jani Hartikainen has a few suggestions on how to handle exceptions in your application - more specifically how to handle them in your classes and still keep proper abstraction.

So you already know how to handle your errors properly. Even if you're already using exceptions, there are some nuances to the use of exceptions that are important to know and understand in order to write code that is easier to reuse and more decoupled. Let's talk about exceptions and how they relate to your classes and abstraction.

He looks at classes/abstraction, how they relate to normal and custom exceptions and how to design your code better to wrap exceptions in custom handlers to make maintainability even easier. He also suggests catching everything in more general exceptions as well, giving you an overall way to handle abstracted exceptions.

0 comments voice your opinion now!
exception abstraction class tutorial


blog comments powered by Disqus

Similar Posts

PHPBuilder.com: An Introduction to Graphs Using PEAR\'s Image_Graph Package

PHPMaster.com: Introspection and Reflection in PHP

Jani Hartikainen's Blog: Using a builder to construct complex classes

Elliot Haughin's Blog: Building UTF8 Compatible CodeIgniter Applications

Jani Hartikainen's Blog: Zend_Acl part 2: different roles and resources, more on access


Community Events

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


introduction api configure example php7 podcast release interview framework language part2 voicesoftheelephpant laravel opinion performance application community symfony2 series conference

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