Tag Info

New answers tagged

1

This seems like the sort of situation where XML would work well. You can start with basic tags for things like being required, or being a given length, etc; and if later you get new requirements that need a new kind of constraint, you just add a tag and code to check for that tag.


1

Most languages have some sort of validation library available to you. In C#, for example, I've used FluentValidation, which allows you to specify your business rules with a fluent API. public class Post { public string Title; public string Body; public DateTime CreatedAt; } And the validator: public class PostValidator : ...


0

I used a utility program many years ago which did a similar thing. Given a flat file, it could parse each record and check each column met certain requirements. The basic blocks were types, ranges and values. Types were very basic ones such as: String Int Float Date For some of these columns, ranges could be defined. For example, you could say that for ...


2

My experience is that it isn't worth spending too much time on perfecting a syntax for expressing requirements. The requirements will change again, and very probably in ways that you didn't anticipate, so it's unlikely that you will hit on the perfect solution in any reasonable time frame. It is usually easier to just keep around the old parsing code as a ...


1

You're right. Storing program/service configuration information in system shell environment variables is not just "a pretty clunky way of storing the information." That's far too nice. The truth is, it's an entirely craptastic way of storing configuration information. On the plus side, almost all OSs have an environment variable mechanism. And I do mean ...


0

There are often several environments that a system works in. There is some combination of the dev's machine, a common development system, testing, staging, and production... possibly multiple production environments in situations where one server is built for each client. Lets take the simplest of these situations: dev and production. And you've got a ...


0

Does this mean that properties like the DB username / password, resource URL should be stored as a part of Java Env variables rather than as property files? Environment variables are not secure enough for this purpose. A litmus test for whether an app has all config correctly factored out of the code is whether the codebase could be made open source ...


0

In our team we do code reviews with Gerrit now, and since we started it became easier to keep everyone in the loop about code changes. The team is relatively small, and everyone reviews everyone others changes, so the awareness of them is quite high. We've agreed to start a day with code reviews, and code doesn't go to master branch before being reviewed, so ...


0

You could use a slightly difference structure in your table, if you still wanted to go with a table-based solution: key_values ---------- id parent_id key value type_constraint_id type_contraints --------------- id name and then populate it like this: key_values ---------- id | parent_id | key | value | type_constraint_id ...



Top 50 recent answers are included