473,813 Members | 4,176 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

General Advice - objects, classes and coding style

I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class files corresponding to code names.

I've cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.

Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?
Oct 24 '07 #1
4 1341
turnitup wrote:
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class files corresponding to code names.

I've cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.

Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?
Personally, I don't use __autoload. It isn't that hard to add
require_once statements where necessary.
--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===

Oct 24 '07 #2
Greetings, turnitup.
In reply to Your message dated Thursday, October 25, 2007, 00:52:55,

tI am in the process of transforming a procedural code base into an OO
tcode base. The code lends itself to this refactoring and it is proving
tan effective exercise.

tHowever, I am running into a few irritations.

tI am using __autoload to load class files corresponding to code names.

tI've cranked up error reporting, but if for some reason there is a
tsyntax error or whatever in a class, the application crashes with no
texplanation. The bug hunt takes ages and lots of echoing.

tIs there anything I can do to help myself? Use of assert, or exceptions,
tor try-catch handling?

Did You read user comments on Autoloading Objects article?
http://ru2.php.net/autoload
There's some useful info and good examples.
--
Sincerely Yours, AnrDaemon <an*******@free mail.ru>

Oct 24 '07 #3
On Oct 24, 4:52 pm, turnitup <same@samewrote :
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class files corresponding to code names.

I've cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.

Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?
You might have turned up error reporting, but did you enable display
errors? If not you won't see them. You should always enable
display_errors when developing, and disable it in production. In
production use log_errors so your error messages go to a file instead.

Oct 25 '07 #4
On Oct 24, 2:52 pm, turnitup <same@samewrote :
I am in the process of transforming a procedural code base into an OO
code base. The code lends itself to this refactoring and it is proving
an effective exercise.

However, I am running into a few irritations.

I am using __autoload to load class files corresponding to code names.

I've cranked up error reporting, but if for some reason there is a
syntax error or whatever in a class, the application crashes with no
explanation. The bug hunt takes ages and lots of echoing.

Is there anything I can do to help myself? Use of assert, or exceptions,
or try-catch handling?
I would definitely check your php.ini's Error Reporting settings. To
find out what your PHP's settings are, you can make a new php file and
put:

<?php
echo phpinfo();
?>

It will show you where your php.ini file is, as well as your
display_error settings.

Oct 25 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

20
1967
by: syd | last post by:
In my project, I've got dozens of similar classes with hundreds of description variables in each. In my illustrative example below, I have a Library class that contains a list of Nation classes. In one case, I might want a Library class with only Nations of with the continent variable "Europe", and so I'll do something like library.getContinent('Europe') which will return a Library() instance with only European nations. Similarly, I...
2
1691
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © # in Python, one can define a boxed set © # of data and functions, which are © # traditionally known as "class". © © # in the following, we define a set of data © # and functions as a class, and name it xxx © class xxx:
2
1306
by: kneejerkreaction | last post by:
I did not know where else to post this since there is no forum for general OOP questions. I am just getting into OOP after a lifetime of procedural programming. I'm developing a Help Desk Ticketing System and am struggling with what should be classes and what things should be properties of classes. So far I have for classes Tickets and People. I know both will need subclasses. Some of the ticket properties will be Problem and Solution. But...
7
1599
by: Daniel Ervi | last post by:
Hi All, I have a question for the group as I can't seem to come up with any suitable solutions. I'm not that new to programming or C#, but neither am I very fluent yet, so I'd appreciate any help at mastering my craft. What I am trying to do is best illustrated in code: public class TBase
9
2667
by: Laban | last post by:
Hi, I find myself using static methods more than I probably should, so I am looking for some advice on a better approach. For example, I am writing an app that involves quite a bit of database operations on purchase orders and inventory. I have created a PurchaseOrder class and Inventory class to encapsulate operations like creating POs, finding items, etc. These two classes are used extensively from different parts of the app.
2
3187
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the problems that I have encountered to date and the solutions (if any) that I found. http://users.adelphia.net/~brianpclab/ServerControlCollectionIssues.htm This page also has all of the source code in a compressed file that you are free to download...
3
1482
by: JezB | last post by:
What's the generally accepted approach for using Styles and Stylesheets in a web application based on .aspx files, Web Controls, User Controls, and code-behind modules (c# in my case)? Most style and stylesheet guides on the internet seem to be based on web sites (rather than applications) based on relatively static textual information. I have read that external stylesheet files are the way to go, but it seems to me that these only lend...
0
1076
by: Willie Neal | last post by:
I'm new to vb.net and would like the advice of my peers. Here is my scenario: I have a user control which consists of three buttons, three listboxes and three labels. When the user selects a button an associated listbox is made visible. The user can then select her choices which will be used for a reporting filter down the line. I've created a user control to house these controls and put the user control on a form, I will have perhaps 4...
11
1484
by: calmar | last post by:
Hi all, since I'm just a 'handicraft'/beginner or so, could anybody provide me with some (rough) hints, about how to enhance the code here: http://calmar.ws/tmp/cal.html Cheers and thanks a lot
0
9734
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10665
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10406
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10420
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10139
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7681
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4358
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3029
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.