Re: Easier access to PropertyInfo
- From: Marco Spatz <marco.spatz@xxxxx>
- Date: Mon, 28 Apr 2008 15:51:51 +0200
Hi Marc,
thanks for your fast answer.
I want the user of the framework to be able to create a connection like
this:
graph.AddConnection(i.Input, o.Output);
A few options leap to mind:
Te simplest is just a half-way house is to handle the lookup inside the
method:
graph.AddConnection(i, "Input", o, "Output");
But of course it still isn't compiler-verified.
But it's easier than my current approach, so if everything fails, I'll do
it that way.
You could do various things involving delegates and lambdas, including
treating a lambda as the missing "infoof" operator, which would allow
you to refer to a property directy (and safely), but simply: they are
all quite complicated.
That said, you are also duplicating a lot of what Binding does (at least
for the UI).
I don't worry about complicated solutions for this problem, as long as the
usage for the user of the framework get's simpler :D.. But I'm sorry, I
forgot to mention that I'm using C# 2.0, so lambdas won't apply here I
think :(
You haven't really indicated how it would be *used* (i.e. end-to-end,
not just creation), which probably counts for a lot in terms of giving
the best reply...
Ok, so here's what the framework should be used for:
The (dev) user can creates a tree graph by adding custom nodes and creating
connections. The connections are made between properties of nodes. Those
properties are marked declarative by using an [Input] or [Output]
attribute.
The nodes transfers the data from inputs to outputs on update calls, and
the connection transports the data from one node's output tp the connected
input of another node.
In my current domain, the tree represents a query to a custom datamodel.
The creation of the query is supported by a UI.
After creating the query tree, the user sets an input collection and calls
evalute on the tree. Inside, the tree nodes and connections are sorted to
be evaluated in the correct order, and then their update methods are
called.
The result of the query is the output of the last node.
Bye,
Marco
.
- Follow-Ups:
- Re: Easier access to PropertyInfo
- From: Marc Gravell
- Re: Easier access to PropertyInfo
- References:
- Easier access to PropertyInfo
- From: Marco Spatz
- Re: Easier access to PropertyInfo
- From: Marc Gravell
- Easier access to PropertyInfo
- Prev by Date: Re: Get the attribute of a class within this class
- Next by Date: Re: IsArray?
- Previous by thread: Re: Easier access to PropertyInfo
- Next by thread: Re: Easier access to PropertyInfo
- Index(es):
Relevant Pages
|