Basic quetion about domain model and design pattern

J

Julia

Hi,

I have asked this before,and I didn't get answer, I guess I didn't properly
explain self

I have a domain model in which the lower component-Channel- in the hierarchy
can be replaced
at run time,using reflection

Application[m_ApplicationContext]
-->Manager
------>MessagingService
---------->Channel

The problem which I faced is that different type of Channel expect different
set of properties
and I would like not to us a HASH table or a collection,
The properties are being loaded by the application into the application
context

I am looking for a way to easily replace the channel,and the application
context
and to notify the channel when one of its properties was changed.


Thanks in advance
 
?

=?ISO-8859-1?Q?=22Patrik_L=F6wendahl_=5BC=23_MVP=5

Well basicly you could use reflection to find the properties when your
loading the channel object into the application context. Theres a method
on the Type object called GetProperties

Additionally you could create a custom attribute and mark the properties
you wan't to work with.

One note on this technique tough, reflection is slow. I would implement
some kind of identitymap and store properties for specific channels there.
 
A

Anders Norås

I am looking for a way to easily replace the channel,and the application
context
and to notify the channel when one of its properties was changed.

I suggest that you take a look at the Spring Framework at
http://www.springframework.net at the core this framework has an Inversion
of Control container enabling you to configure relationships between
different objects in XML instead of in code.

Anders Norås
blog: http://dotnetjunkies.com/weblog/anoras/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top