Tag Info

Hot answers tagged

23

That would be super obnoxious. You: Wouldn't be able to see them all at once Wouldn't be able to place comments explaining why things are set the way they are Wouldn't be able to have documentation on what commands do, or what possible options are right in the configuration It would make backing up/version controlling your configs more obnoxious. Using a ...


17

My experience with developing on VMs in a corporate environment is that due to virtualisation of multiple cores being fraught with difficulties, it's difficult to get the kind of performance that many enterprise development machines need. Getting the code-compile-test inner loop to be as fast as possible requires the best machines possible - compilation and ...


14

I think the first one will give you the ability to create a config object elsewhere and pass it to ExampleA. If you need Dependency Injection, this can be a good thing because you can ensure that all intances share the same object. On the other hand, maybe your ExampleA requires a new and clean config object so there could be cases where the second example ...


13

I don't have a problem with a single config object, and can see the advantage in keeping all settings in one place. However, using that single object everywhere will result in a high level of coupling between the config object and the classes that use it. If you need to change the config class you may have to visit every instance in which it is used and ...


11

Martin Fowler and Pramod Sadalage have written an excellent article on this subject. Every developer has his own database to which changes can be made. These changes are then communicated back (as a changeset) to the DBA who implements them in the master database, so he's still involved in the process, he probably knows best about the structures and needs ...


10

Configuration Management encompasses "everything else" that's not directly related to writing code. So it's how you manage releases, how you manage and triage bug reports and feature suggestions, how you perform your builds and so on. It often also includes how your source code is managed (e.g. what version control you use, branching strategies, how you ...


8

I think the better question is: Is what your doing now currently working for YOU? Alot of "experienced" programmers are quick to jump and say what is wrong and what is right, but sometimes what is right for them might not be the best for you. Just something to take into consideration, IMO if what your doing now is working well, I see no problem with keeping ...


8

I would like to add that certain types of development are much more difficult (if not impossible) through virtualized machines. I happen to work at a company where we offer software packages that integrate with a number of different USB peripheral devices (Eg. webcams, label printers, magnetic stripe readers, etc...). Even if I were to map USB ports to a ...


8

Do not forget about testability! Usually if the behavior of Example class depends on the config you want to be able to test it without saving/modifying the internal state of the class instance (i.e. you would want to have simple tests for happy path and for wrong config without modifying the property/memeber of Example class). Therefore I would go with ...


7

With PHP in particular; the difference between an .ini file and a .conf.php file is negligible. Using PHP directly for configuration has the distinct advantage of only needing to relate to one well-defined, portable syntax for configuration, and the fact that the configuration file is properly code is occasionally useful. Compared to that; an ini file has ...


6

I do all my personal development in VMs. I have several VMs setup for different environments and it works fine. I have a dell studio 15 laptop (quad I7 2.8ghz, 8gb ram, ati graphics) running win 7 ultimate 64bit with virtualbox installed on. I have all my VMs running off an external 500gb usb drive velcroed to the laptop. VM 0 - Win 7 64bit clean install ...


6

This is a perfectly fine way of representing tree-shaped data. A file system is a tree database, why re-implement one on top of it? The most well-known implementation of this idea is the Windows Registry. Its main flaw is that it implements a filesystem alongside the filesystem and doesn't support the filesystem API, which means you can't use filesystem ...


5

IMO, somebody's first few years in an industry set an internal standard for what is acceptable and what isn't. I seriously question if working somewhere who a) doesn't know better and/or b) doesn't care, is good for your long term career. I'd suggest alerting them to the problem (in a non-condescending manner) and if they don't make it a priority to fix ...


5

Suggestions 1) Use two different SVN repositories. 2) re-structure the current (I'm assuming, single) SVN repository to: /cm/trunk/ /cm/branches/ /cm/tags/ /project/trunk/ /project/branches/ /project/tags 3) If the CM is specific to the project: /project/dev/trunk ... /project/cmd/trunk ...


5

In our company we are now using the VM for development and testing. Although there are some drawbacks for using VM's the benefits significantly outweighs them. Before we started using the VM's we were having constant problems with setting up development machines for new developers. The first task for new developer in the team was usually to set up his own ...


5

As others have mentioned it depends on several things: What does your environment look like? Do you have sufficient access rights to do development? Is your HW up to snuff? Environment Using a VM can help if you are working on multiple versions of a project; multiple projects; or targeting a different OS from the one you normally run (host OS). I do a ...


5

If your team find email disruptive or tune it out, something is wrong (they've set their notifications to be too in-your-face, or they're getting too many private emails, or they haven't set up filters/triggers properly). Email is, in my opinion, the perfect tool for this. Set it up right and it will serve its purpose. You could do something silly and ...


5

There are many other pressures: Writing a config file requires write permission on the file system (in fact, it requires a file system in the first place!). Environment variables can be set even if you are running a rescue system from a CD. Environment variables can be set quickly and temporarily just for one invocation, which is much better for use in ...


5

I would say it's better to have multiple small classes with a single responsibility than one big god-configurator, even if that means you will have some duplication. If the duplicate logic is complicated, (I'm assuming that printLevel was just an oversimplified example) then you can solve it with creating an object specifically for printLevel and packing it ...


5

I generally go option 2 BUT I have multiple columns to enforce data type ConfigOption | textValue | DateValue | NumericValue Option 1 Has the addtioal Benifit that you can very easly "Swap" entire Configurations by adding an Active Column.


5

After looking at your requirements, and seeing that you have a dislike for XML, I would advise you to go with JSON. I must admit that I've only dealt with XML and JSON, so I cannot speak for any other common configuration formats out there. JSON is really easy to write, and if formatted correctly, easy to read. Google just LOVES JSON for configuration use ...


5

I think YAML is best fit for your case. To my understanding, YAML is the de facto standard format for configuration files that need to be edited by hand. Many programming languages have a library for reading and/or writing YAML. JSON is closely related to YAML, but is little bit less easier to write than YAML, and is used more for communication between web ...


5

The same question arises in most of projects I work on. Usually I do this: If the set of possible values is unlikely to change any time soon, I use class/interface constants in the code and enumerable fields in the database. Example: state of publishing of blog entries: 'not published', 'under moderation', 'published', etc. Values will probably change, but ...


4

I segregate groups of related settings with interfaces. Something like: public interface INotificationEmailSettings { public string To { get; set; } } public interface IMediaFileSettings { public string BasePath { get; set; } } etc. Now, for a real environment, a single class will implement many of these interfaces. That class may pull from a ...


4

We had a similar problem at my work. We solved it by not using the config files. We wrote the things that when changed required a code change any way in code, and then moved the rest of the properties to a settings table in a database. We wore able to do this because we control every server we deploy code on. This change simplified our systems drastically ...


4

If the object has responsibility for managing the lifetime of the dependency, then it's OK to create the object in the constructor (and dispose it in the destructor).* If the object is not responsible for managing the lifetime of the dependency, it should be passed into the constructor and managed from outside (eg by an IoC container). In this case I don't ...


4

Generally speaking I prefer .ini or XML configuration files. In larger systems, often someone other than the developer will need to change a configuration value, possibly a DBA or a sysadmin. Most DBAs and sysadmins I know wouldn't have any problem navigating through a simple PHP script, but I would prefer if they didn't. One small mistake in there can harm ...


4

Many of the Spring annotations are now standardized (e.g. CDI for dependency injection), so you're not at all tying yourself to Spring by using them. And for those that aren't: your application won't work without the functionality, will it? So it's basically tied to Spring, whether or not you try to hide that fact. Annotations are much better for ...


4

In addition to an excellent answer provided by @whatsisname: It won't be possible to make two elements of the same name; It won't be possible to share the config; It won't be possible to make custom order of elements; Different file systems have different limitations as per file names. They also have reserved names, like CON or NUL for Windows; Also, file ...


4

Personally I'd use Settings, its xml based, but the real benefit is that MS have already done all the coding for you for most types (including both global settings and per user overrides), so it really simple to use. as Wyatt points out in his answer it is also possible to extend using custom configuration sections (personally I find this overkill for most ...



Only top voted, non community-wiki answers of a minimum length are eligible