473,408 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

when will php support alias name?

When using c++, we could do:
using abc = xxx.yyy; // am i right?

When using python we could do:
import abc.efg as efg

When will php support:

class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?

It is very useful to me.
Or do you have any good ideas to do such name alias?

Jul 24 '07 #1
5 1398
On 24.07.2007 10:36 Yarco wrote:
When using c++, we could do:
using abc = xxx.yyy; // am i right?

When using python we could do:
import abc.efg as efg

When will php support:

class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?

It is very useful to me.
Or do you have any good ideas to do such name alias?
Yes. Wait till php6 comes out. ;)
--
gosha bine

makrell ~ http://www.tagarga.com/blok/makrell
php done right ;) http://code.google.com/p/pihipi
Jul 24 '07 #2
Hey, friend. Do you know any good websites/forumns related to php6?
News and details.

On Jul 24, 4:46 pm, gosha bine <stereof...@gmail.comwrote:
On 24.07.2007 10:36 Yarco wrote:
When using c++, we could do:
using abc = xxx.yyy; // am i right?
When using python we could do:
import abc.efg as efg
When will php support:
class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?
It is very useful to me.
Or do you have any good ideas to do such name alias?

Yes. Wait till php6 comes out. ;)

--
gosha bine

makrell ~http://www.tagarga.com/blok/makrell
php done right ;)http://code.google.com/p/pihipi

Jul 24 '07 #3
On Jul 24, 4:36 am, Yarco <yarc...@gmail.comwrote:
When using c++, we could do:
using abc = xxx.yyy; // am i right?

When using python we could do:
import abc.efg as efg

When will php support:

class My_Best_Class
{}

define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?

It is very useful to me.
Or do you have any good ideas to do such name alias?
It sounds like you want the ability to change which class you use for
something by just changing it in one place. So, you might have
something like this:

define('DatabaseConnection', 'MySQLDatabaseConnection');

which could then later be easily changed to:

define('DatabaseConnection', 'OracleDatabaseConnection');

Without modifying the rest of your code. Is that what you're trying
to achieve? If so you should use the factory pattern:

class DatabaseConnection {

public static function factory() {
return new MySQLDatabaseConnection();
}
}

class MySQLDatabaseConnection extends DatabaseConnection {

....

}

etc.

Jul 24 '07 #4
I find one:
http://oss.backendmedia.com/PhP60

On Jul 24, 5:26 pm, Yarco <yarc...@gmail.comwrote:
Hey, friend. Do you know any good websites/forumns related to php6?
News and details.

On Jul 24, 4:46 pm, gosha bine <stereof...@gmail.comwrote:
On 24.07.2007 10:36 Yarco wrote:
When using c++, we could do:
using abc = xxx.yyy; // am i right?
When using python we could do:
import abc.efg as efg
When will php support:
class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?
It is very useful to me.
Or do you have any good ideas to do such name alias?
Yes. Wait till php6 comes out. ;)
--
gosha bine
makrell ~http://www.tagarga.com/blok/makrell
php done right ;)http://code.google.com/p/pihipi

Jul 25 '07 #5
When will php support:
>
class My_Best_Class
{
}
define('MyClass', 'My_Best_Class');
$o = new MyClass; // use MyClass as aliasname of My_Best_Class?
Never, I hope. If you cannot even trust your identifiers, all hope of
maintaining code is gone forever.

Especially the example is stunning. This has nothing to do with object
orientation. If you do this the object-oriented way, you can use
factories, interfaces and subclasses.
Off course, a factory is a method (or a function), so you can SEE that
it is defined elsewhere. And you can even pass it parameters.

Best regards,
--
Willem Bogaerts

Application smith
Kratz B.V.
http://www.kratz.nl/
Jul 25 '07 #6

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

Similar topics

6
by: Jason | last post by:
Sorry for the post here but could not find an Exchange newgroup. I developed an application a year or 2 ago that sends SMTP email. The application allows the user to customize the text from...
7
by: James Foreman | last post by:
We have 5 users of our database (DB2 UDB 8.1 on SuSE linux) : db2inst1 bill fred sarah jessica The tables are created under db2inst1, which has the ability to drop/create/alter/etc. bill,...
10
by: Alex | last post by:
Hi, We have UDB 7.2 running on window 2000 server name SERVERDB2UDB01(example) Until we move to version 8 we want to move our production on another sever Steps we want to do 1. install...
5
by: Santiago Ordax Solivellas | last post by:
Hi. We have almost all our tables defined on library lib1 and some on lib2. We have alias defined on lib1 to access tables on lib2 so there is no need to qualify library name. Alias for tables on...
1
by: Susan Bricker | last post by:
Greetings. I am trying to position opened forms so that they are cascaded on the screen. I have discovered the movesize action (for the DoCmd) and Move property of a form (for Acc 2002/2003). ...
1
by: Michael D. Reed | last post by:
I am using the help class to display a simple help file. I generated the help file using Word and saving it as a single page Web page (.mht extension). I show the help file with the following...
10
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that...
9
by: PengYu.UT | last post by:
Hi, I feel argparse has some useful things that optparse doesn't have. But I can't find it argparse in python library reference. I'm wondering when it will be available in the python standard...
32
by: Joe | last post by:
I am just starting to use Object Oriented PHP coding, and I am seeing quite often the following (this example taken from a wiki): $wakka =& new Wakka($wakkaConfig); What exactly is the =&, and...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.