Ayende @ Rahien

Unnatural acts on source code

Challenge: What is the problem?

This code is part of a DSL that is used to generate quotes. In particular, this bit is used to build the dependency graph for the engine to run on.

specification @vacations:
	requires @scheduling_work
	requires @external_connections

There is a serious design issue with this bit of code. Can you figure it out?

Hints:

  • It has nothing to do with the implementation.
  • It has nothing to do with the actual engine running this.
  • Look for what isn't there.
  • It is only a problem when you scale up.
  • And no, there are no performance problems whatsoever.

Comments

Jon Lebensold
08/03/2008 01:48 PM by
Jon Lebensold

OK, I'll bite since no one else has taken the bait.

Your calls to external connections in large systems should be asynchronous and not part of a local specification.

Ayende Rahien
08/03/2008 02:07 PM by
Ayende Rahien

This is a DSL that builds the model, not run it, there are no external calls

Nathan
08/03/2008 10:45 PM by
Nathan

How do you determine precedence of the dependencies? Precedence of dependencies could cause a NP problem as the system scales up if there are not rules about it.

I doubt this what you are looking for though since you said it's not a performance related issue.

Adam
08/04/2008 02:52 PM by
Adam

namespaces?

Mike Brown
08/04/2008 03:11 PM by
Mike Brown

Shouldn't the work scheduling have a dependency on vacations rather than the other way around? When you schedule work, you have to take into account existing vacations.

Chris
08/04/2008 07:27 PM by
Chris

What is this external_connections thing? It doesn't sound anything like a business concern. It sounds like some sort of data access system using IPC.

Ayende Rahien
08/04/2008 07:44 PM by
Ayende Rahien

@Chris,

It is a module, its inclusion is a business concern.

@Mike,

Stranger business rules have exists in the past :-)

Comments have been closed on this topic.