Simple Question:

Is it better to use "dhcp" or OSCAR::SystemServicesDefs::DHCP() that returns 
"dhcp".
I'm asking because /usr/share/perl5/vendor_perl/OSCAR/OCA/OS_Settings/default
has variables like dhcp_service.
Thus, if se use OSCAR::SystemServicesDefs::DHCP() we'll need to make sure that 
SystemServicesDefs.pm and OS_Settings/* are in sync.

More over, adding variables for service names will require adding definitions 
in SystemServiceDefs.

I have no preferences for one or the other method.
=> using OSCAR::SystemServicesDefs::DHCP()
PRO:
- It's clean.
- It's already in place.
- If SystemServiceDefs and OS_Settings/* files are updated, a value can be 
changed without touching the OSCAR whole code.
- Compilation fails if service is unknown to SystemServiceDefs 
OSCAR::SystemServicesDefs::DHCPD() # trailing D added by mistake would fail.

CONS:
- don't know if it refers to a service name, a package name or any other stuff 
(but it's part of SystemServiceDefs though)
- needs to make sync between SystemServiceDefs and OS_Settings/* files

=> using "dhcp"
PRO:
- no need to sync with SystemServiceDefs
- Coding is the same if service is known to SystemServiceDefs or not (no need 
to check how the service is named in SystemServiceDefs).

CONS:
- mistakes are possible (using service unknown from oscar). Example, you could 
use "proftpd" as service name which is unknown from oscar, thus it wouldn't be 
tested in test units and more over it's a hard-coded name that prevent to chose 
the tfp service per OS. It would work on system were proftpd is installed and 
fail on system without proftpd.
  The correct way would be to use the generic name "ftp" that would defined as 
ftp_service in OS_Settings/*

IMHO, OSCAR::SystemServicesDefs::DHCP() is the way to go as eventhough is a 
little bit harder to put in place, it's enforce good practice and make sure 
that oscar doesn't handle services that are unknown to it.

What do you think?

Regards,

Olivier.
--
   Olivier LAHAYE
   CEA DRT/LIST/DM2I/DIR
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
Oscar-devel mailing list
Oscar-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oscar-devel

Reply via email to