Welcome Guest ( Log In | Register )


Check out the FREE chatroom mod for IPB 3.x

> About IPB SDK

Bugs should be reported on the Bug Tracker. To download the latest bleeding-edge version of the SDK, head over the SVN repository.

 
Reply to this topicStart new topic
Modularizing IPB SDK
cowweb
post Dec 5 2004, 04:48 AM
Post #1


recursion n. see recursion
******

Group: Members
Posts: 2,673
Joined: 11-April 03
From: 127.0.0.1 :)
Member No.: 855
IPB Version: 1.3.x



Just a thought smile.gif Although the SDK is pretty fast, the main class does have quite alot of functions which are rarely used. The biggest example is the PM functions, which I implemented sometime around Version 0.2, before we had modularization.

By modularizing the PM section, this would probably cut out about a quarter of the code from the main SDK file, so there should be some performance benefit in it.

Those who want to use PM functions will need to call the factory method first, before calling any functions.

Instead of $SDK->add_pm_folder("New Folder"), for example:

$pm =& $SDK->factory("PM");
$pm->add_folder("New Folder");

The same could probably be done for other functions such as emailing etc. If BC is a problem, the old methods in the SDK class can be depreceated but simply provide an interface to the modularized code. As an example:

PHP


function add_pm_folder($name) {
if (!isset($this->PM)) {
$this->PM =& $SDK->factory("PM");
}

return $this->PM->add_folder($name);
}



Cow


--------------------
Go to the top of the page
 
+Quote Post
jakey
post Dec 5 2004, 09:50 AM
Post #2


ibsmarter
***

Group: Members
Posts: 464
Joined: 28-April 03
From: MA, USA
Member No.: 7,250
IPB Version: Not Applicable



humm that would be a good idea... and it would cut down on the class file being soo big...


--------------------
Thinking... Coding... Creating...
IP.B MarketPlace Creator
Go to the top of the page
 
+Quote Post
Pita
post Dec 5 2004, 11:09 AM
Post #3


It's fun to rhyme :)
******

Group: Members
Posts: 3,482
Joined: 28-June 04
From: United Kingdom
Member No.: 114,860
IPB Version: Not Applicable



cheers cow...
this is a good idea, and i generally use modules in my code...
maybe for final, this is what i'll go for smile.gif


--------------------
Please don't PM/IM/Email me for support
(anything I get will be ignored)
Note to all: EXAMS SUCK
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." - Douglas Adams
IPB SDK - Sourceforge | SVN | Support Forum | Bug Tracker | 1.6 Beta 5 (for IPB 2.1.x)
Other - PHP Manual [UK] | Amazon Wishlist | IZE Bug Reports
Go to the top of the page
 
+Quote Post
Pita
post Dec 17 2004, 11:27 AM
Post #4


It's fun to rhyme :)
******

Group: Members
Posts: 3,482
Joined: 28-June 04
From: United Kingdom
Member No.: 114,860
IPB Version: Not Applicable



umm, update on this...
i will go for modularisation...
*but*
you won't have to change the way you call the functions...
the SDK will instantiate classes as and when you need them....
isn't it clever? smile.gif


--------------------
Please don't PM/IM/Email me for support
(anything I get will be ignored)
Note to all: EXAMS SUCK
"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move." - Douglas Adams
IPB SDK - Sourceforge | SVN | Support Forum | Bug Tracker | 1.6 Beta 5 (for IPB 2.1.x)
Other - PHP Manual [UK] | Amazon Wishlist | IZE Bug Reports
Go to the top of the page
 
+Quote Post
cowweb
post Dec 17 2004, 01:08 PM
Post #5


recursion n. see recursion
******

Group: Members
Posts: 2,673
Joined: 11-April 03
From: 127.0.0.1 :)
Member No.: 855
IPB Version: 1.3.x



sounds great smile.gif


--------------------
Go to the top of the page
 
+Quote Post
phatmonkey
post Dec 17 2004, 07:24 PM
Post #6


Member
**

Group: Members
Posts: 103
Joined: 27-July 04
From: UK
Member No.: 118,177
IPB Version: 2.3.x



As long as it doesn't slow it down... (too much tongue.gif)

This post has been edited by phatmonkey: Dec 17 2004, 07:24 PM
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 2nd September 2010 - 09:08 AM
Invision Skins · IPB Skins