|
Posted by Weird-beard on 10/31/29 11:32
So the "perfect" OO-Script would consist on the global level of only
class
definitions, maybe some constant definitions or global configuration
variables and one simple instantiation statement at the end which would
(via
the constructor function) start the actual processing?
- The appropriate word is could consist on. Depending on your
requirements. You dont always need such stuff.
Might I not encounter a situation where a function is of a "global"
nature,
meaning that it is needed by several objects and cannot really be
associated
with any existing class? Should I create a new class with a single
element -
that function - then?
- You wont need a global natured function, think about it. All you need
is global classes, residing on your toolbox. String is an object on
full oo languages.
By the way: are there some good articles on the net which discuss such
issues in more detail? Detailed advice on good coding practise is not
available in the manual.
- OO php is getting better. But, I dont think it is currently geared
towards people developing only php, as you will not be able to find
many references on oo php. Oo is not a new concept, nor it is just an
issue of php. Php started to use it, for users who had already been
developing oo programs, as the software developers needed it. If you
would like to learn more about oop, you can look at any language.
dotnet, c++, java (especially java). The concepts are the same,
sometimes the names differ. (Although I would not recommend getting
into Microsoft references, as most of them are a waste of time, as they
are geared towards only dotnet architecture and usage). Good coding
practice is not the word, the word is good object oriented design or
architecture. Good coding practice is naming functions passing
parameters etc. OOdesign is more.
Navigation:
[Reply to this message]
|