LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-08-2022, 05:30 PM   #1
TBotNik
Member
 
Registered: May 2016
Location: Greenville, TX
Distribution: Kubuntu 18.04
Posts: 681

Rep: Reputation: Disabled
Programming question


All,

Not sure if this is the right place to put in an OO question, but here it is!

I've been using OO for several years, but still count myself a noobie!

I use OO in PHP files.

So I have a main objects file with this code:

Code:
 	class my_modules {

		function __construct() {

		}     // end function __construct

	}   // end class my_modules

Which I call in my process file with:

Code:
	$my_mods	=	new my_modules();
Now I found these great data processing object files, so trying to link them and
use them. Not sure about the right including and calling syntax, so proposing
using this and need feedback on whether this is right way to do this.

Code:
	include_once ( 'data_io,php' );
	include_once ( 'data_format,php' );
	include_once ( 'data_grid,php' );
	
 	class my_modules {

		function __construct() {
			$this->dio	= new data_io ();			
			$this->dfm	= new data_format ();			
			$this->dgd	= new data_grid ();			
		}     // end function __construct

	}   // end class my_modules
And then calling with:

Code:
	$my_mods	=	new my_modules();
	$my_dio		=	new my_mods->dio();
	$my_dfm		=	new my_mods->dfm();
	$my_dgd		=	new my_mods->dgd();
So what corrections are needed for this to work right?

Cheers!

TBNK
 
Old 10-08-2022, 08:53 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 18,490
Blog Entries: 28

Rep: Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833Reputation: 5833
What precisely do you mean by "OO"? Your references to PHP lead me to think it's not Open Office.
 
Old 10-08-2022, 08:59 PM   #3
timl
Member
 
Registered: Jan 2009
Location: Sydney, Australia
Distribution: Fedora,CentOS
Posts: 739

Rep: Reputation: 155Reputation: 155
I'll have a stab at Object Oriented. Unfortunately I can't help further
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
future of programming, programming jobs, programming languages? detr Programming 17 08-01-2016 04:46 PM
which programming language is used to do tcp/ip programming?? gajaykrishnan Linux - Networking 9 12-21-2012 06:16 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:06 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration