1
rowdie
Action item #2 - Module development standards
  • 2005/3/9 17:10

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


I saw quite a few things in the Wiki that I thought needed changing, so I decided it was easier to just put it all in a single document - that way you can still compare my doc with the Wiki.

The Word doc included with this post therefore consists of everything in the dev wiki relating to module standards, plus ideas taken from forum posts and my own ideas.

I've also included examples of the documents which in my opinion should be included with a module release, and therefore should also be part of the QA process.

This is just a first draft. I'm hoping for some feedback

Rowd

2
Mithrandir
Re: Action item #2 - Module development standards

A few comments:
Quote:
XOOPS modules should follow the principles of object oriented programming. Use of classes and class methods for data manipulation is essential.

Yes and no to that one. Yes, I think module developers should go OO because it is usually easier to read and that is the direction we are heading in the core. However, if the module developer is more at home with using functions, we should not force OO onto him or her.

Separating model from controller is more important than using OO, so as long as repetitive or difficult-to-understand processing as well as SQL queries are done in descriptively named functions, then I am happy.

I also think that the next paragraph about forms could use a Quote:
Using Smarty templates for form output is optional

and also add that to the next paragraph (new text in bold)
Quote:
Templates complete the MVC separation of the code and is a very important part of making modules easy to understand and customize. They must be used for all module output, except rendering XoopsThemeForm objects, which is optional

3
Mithrandir
Re: Action item #2 - Module development standards

Uh, also - as we have discussed on dev.xoops.org, table indexes are very important and should have as much highlighting as the directive about reducing the number of SQL queries as indexes (or rather - the lack of indexes) can have a huge impact on SQL performance.

4
rowdie
Re: Action item #2 - Module development standards
  • 2005/3/9 19:26

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Thanks for the comments, Mith.

I've added your suggestions about Smarty templates for forms being optional.

Now I'm working on rewriting the section on classes and functions, and adding a new section about MySQL indexes. That's proving a little difficult because this isn't a guide, it should just be a list of standards really... and I'm not sure that indexes should be part of the QA standards test... I mean, how do you make it a concrete rule? "There should be an index on the database table if the WHERE clause involves a field other than the primary key, or more than one field with an AND statement between the fields, and the table is likely to contain many records"? Not very reasonable, and should be a personal choice of the developer, shouldn't it? I definitely agree XOOPS would benefit from increased use of indexes in the modules, but I don't see how it can be made a standard. What are your thoughts?

Rowd

5
Mithrandir
Re: Action item #2 - Module development standards

Well, some of the other requirements also require a futher research (by the developer trying to apply to the standards) so as long as it is explained elsewhere how to accomplish it, I don't see it as a problem to say "the module's database tables must contain proper indexes" with a reference to the guide.

Indexes should not be a personal choice of the developer. OOP approach or functions for dividing the MVC parts can be chosen as it depends on the programmer's programming style, but indexes are too important, I've found out, to be optional.

6
rowdie
Re: Action item #2 - Module development standards
  • 2005/3/9 19:54

  • rowdie

  • Just can't stay away

  • Posts: 846

  • Since: 2004/7/21


Ok, I'll add a page to the dev wiki about indexes, and reference that in this doc. That should work

Rowd

7
Mithrandir
Re: Action item #2 - Module development standards

Great. Good work so far

8
banned
Re: Action item #2 - Module development standards
  • 2005/4/5 17:19

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


Hi there,
I've added a new paragraph on the wiki in the dev site.

Quote:
Use of the $xoopsModule->getVar('dirname')
Don't hardcode your module dirname in your php files and templates. We can translate the module content, if you use this we can translate the module name too with a small change in the module's xoops_version.php (E.G. An Italian website doesn't needs a wordbook module, but it needs a 'dizionario' one)
Since XOOPS v. 2.0.10 a new smarty var is added in the core, <{$xoops_dirname}>, that return the module dirname so you can use this in your templates - if an absolute path is needed.


What do you think about this?

banned

9
Dave_L
Re: Action item #2 - Module development standards
  • 2005/4/5 19:56

  • Dave_L

  • XOOPS is my life!

  • Posts: 2277

  • Since: 2003/11/7


That's a good point, and I have some comments on it, but I think it would be better to discuss that in a new thread, since this thread is concerned with the module development standards as a whole, and not with individual details of the standards.

----
Edit

I've reposted banned's post here. Please discuss it there, rather than in this thread.

10
Marco
Re: Action item #2 - Module development standards
  • 2005/8/28 13:54

  • Marco

  • Home away from home

  • Posts: 1256

  • Since: 2004/3/15


rowdie,

could you please post again your file, that has disappeared due to summer visitors.

Quote:

Action item #2: Review the General Module Development Standards in the Dev Wiki, and specify what changes, if any, are needed before incorporating them as part of the (proposed) QA certification process.

Who is working on this: Dave_L (task leader), rowdie, irmtfan
Target date for completion: 2005-02-23
Status: 0% complete

how things are gone in this area ?


marco
Do synergy or die.

Login

Who's Online

149 user(s) are online (98 user(s) are browsing Support Forums)


Members: 0


Guests: 149


more...

Donat-O-Meter

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

Latest GitHub Commits