1
bingomanatee
Carpenter: self-writing class code for XOOPS

Check out http://www.wonderlandlabs.com/modules/wiwimod/index.php?page=CarpenterSqlApi&back=WebProduction

for self-writing mySQL classes. PHP 5.0 required.


* Dynamic Class Instantiation. Every time you change the database, Carpenter rewrites the core table and record classes "on the fly". Carpenter's two tier class base allows for a "superclass" over each "data class" that can be customized, so you don't lose custom code when the core class is overwritten. (you may have to rewrite custom code if your field names change, but that is pretty much unavoidable.)
* Complete encapsulation of SQL I/O. Records are created with !!MyTable!!->new_record(), saved with a simple save() (that either inserts or updates records) and can be loaded based on criteria with a !!MyTable!!->get_record($pCriteria) call. I rely a lot on XOOPS' excellent criteria class, which is a very flexible way to define a field based query, but straight text based SQL criteria work as well.
* Guaranteed uniqueness of record objects - as all record are created and loaded through the Table object, there is a 1:1 correlation on any given execution cycle between records and their representative objects. As far as I know it is impossible for one context to create, alter and save a record object while another context has a second object representing that same object with different field values. There is NOT an observbable pattern at work here; just a factory that registers all returned record objects.
* Utility relationship helpers: Extensions allow for magic methods to get child records or parent records or other associative data without having to manually add associative methods to each record or table class. Just add the appropriate relationship extension to a table superclass and your record class will magically acquire extra methods to facilitate relationships.
* Direct, filtered field properties: because the fields leverage the 5.0 "Magic" methods, you can refer to them by name. The table class will automatically filter field values based on field type, length, etc. in the background.
* Dynamic loading of table and record classes: Only the classes needed for any given round of execution are loaded in real time. Even though Carpenter generates code for every table in your database, the core database class allows you to load in real time the table and record classes you need without any include() code required on your part. This is again through the PHP 5.0 system.
* Allowance for un-indexed tables: Through using pre_save() code you can manually insert primary key values for records on the fly, that have not been set to auto-increment. This allows for instance SugarCRM-style indexes to be generated based on timestamps or what not for parallel databases or tables that are likely to hold huge numbers of records.
* Optional array-based retrieval of data: the core database allows for criteria based SQL calls that return arrays, single values, etc. so that you do not have to instantiate objects if you want to return a vast number of records, or an array of results with only limited fields etc. This is useful in reports or other situations where read-only, faster results are more important than getting your data in object form.

Note that Carpenter integrates with XOOPS' excellent Criteria system for writing queries. You can pass text based criteria but Carpenter also accepts Criteria objects in record retrival.

2
Herko
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/6 18:26

  • Herko

  • XOOPS is my life!

  • Posts: 4238

  • Since: 2002/2/4 1


[borat mode]Niiiiice[/borat mode]

I've notified Skalpa, but it would be great if you could post your development ideas on the sf.net core development forums.

Herko

3
Catzwolf
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 0:21

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Don't waste your time as Skalpa wont even bother looking at it as he doesn't do with anything else that people send him.

4
JMorris
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 0:37

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Catz,

Please don't discourage positive contributions from the community.

Thank you.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

5
Catzwolf
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 0:51

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Actually its skapla who does, that not me and you know that yourself. The quicker he leaves XOOPS the better it will be for the development process of XOOPS and then I believe we will actually start to have real work done and not the #OOPS# lies we have had for the last three years. IMHO.

6
JMorris
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 0:56

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


If you are not happy with the direction XOOPS is moving, please feel free to go develop your fork. Those of us who are contributing do so to improve XOOPS.

bingomanatee's contribution is welcome. It will be reviewed by Core Developers.

Please don't waist our time with nonsense posts that only serve to start arguments. This thread is about bingomanatee's contribution. Can we please stay on topic?

Thank you.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

7
Catzwolf
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 1:02

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


The only reason people are forking XOOPS (And not only me) is because we feel that we cannot work with Skalpa. The fact is nothing is getting done to xoops, no real direction or real work done on it. Why do you think developers are leaving XOOPS in their drones. I am not the only one who thinks it is time for Skapla to leave XOOPS as he has had his time and doing nothing in the last three years in real work. (Most of the real work was done by Mithy and DJ).

So Skalpa do XOOPS a favor and leave XOOPS before you destroy it and let other people take it over and do something in real terms with it.

And james, let your friend come and actually sign into XOOPS and speak for himself instead of relaying through you.

8
Catzwolf
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 1:21

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


No they are actually to help people open their eyes and see that they are baing lied to for the last three years with regards to new XOOPS and new code.

Skalpa your great on the talk, but you cannot walk the walk. For 4 years (since I was the one who got you into the core area of Xoops) I have heard you talk about Xoopshpere and all this wonderful new code you will bring to Xoops. We have yet to see one line of Actual real work on the XoopsWhere code.

9
JMorris
Re: Carpenter: self-writing class code for XOOPS
  • 2007/5/7 1:25

  • JMorris

  • XOOPS is my life!

  • Posts: 2722

  • Since: 2004/4/11


Quote:
Quoted from XOOPSiquette:

Language - Do not use offensive language. We are here for people of all ages, and want everone to feel comfortable. Offensive language constitutes as profanity, racial, ethnic, and gender based insults or any other personal discriminations, and posts meant to offend or hurt any other member or their work. If you need to say something do it with the facts but not with insults.

Spamming and Trolling - We do not tolerate spamming or trolling in any place.

Topics - Please stay on topic. For general conversation, please use the XOOPS.org Members Lounge forum.


I'm requesting that the community please not comment further on Catzwolf's posts as they are clearly intended to cause discourse.

Now, can we please get back on topic?

Thank you.
Insanity can be defined as "doing the same thing over and over and expecting different results."

Stupidity is not a crime. Therefore, you are free to go.

Login

Who's Online

415 user(s) are online (296 user(s) are browsing Support Forums)


Members: 0


Guests: 415


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits