Forum OpenACS Development: What naming conventions to follow?
I have started to work on the faq module, and have done work on the data-model. The faq module uses naming conventions that are different from the rest of the modules. For example:
The function for a new faq is called new_faq instead of the name new which seems to be the name used to create a new object in a package as followed elsewhere. So, how does one transform non-standard names during porting. Change them in the original Oracle sql file and then follow the porting recomendations, or just leave the Oracle files intact, and then somehow accomodate the different names in the port to postgresql.
I would like to change the original oracle datamodel to conform to the naming standard used in the other modules. Is that recommended?
One wrinkle - we're trying to make upgrade SQL files when we change things, so existing ACS 4.2 users (both of them?:) can move a site over easily if they want. So you want to write an SQL script to drop the old procs and add the new ones and put it in sql/oracle/upgrade. We've been calling our new version "4.2.1" at the moment, for lack of any better idea, so a "4.2-4.2.1" upgrade script would be just the ticket!
The real team approach to things like this is to raise the issue for discussion rather than going off quietly on your own doing something differently than is being done in the rest of the toolkit.
It's not too late to reach a consensus among the non-core package porters, and put this in the Guidelines document as a coding standard. Since there's nothing in there at the moment, people will inevitably make up their own schemes for parameter and variable naming.
I could live with a "one or the other" approach, too, for now - I want code to get ported.
Another thing that I saw usefull is to preserve the parameters name and type with a comment so when we need to use that function is only a matter of cut and paste that part and fill in the values in the correct order. create function wap_user_agent__new ( integer, -- v_user_agent_id in wap_user_agents.user_agent_id%TYPE default null, varchar, -- v_name in wap_user_agents.name%TYPE, varchar, -- v_creation_comment in wap_user_agents.creation_comment%TYPE, boolean, -- v_active_p in wap_user_agents.creation_comment%TYPE default 't integer, -- v_creation_user in acs_objects.creation_user%TYPE, varchar -- v_creation_ip in acs_objects.creation_ip%TYPE );
Thanks for mentioning this idea. A comment such as you suggest would simplify switching over to that style parameter definition if the PG folks change there mind.