473,473 Members | 1,469 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Basic quetion about domain model and design pattern


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
Nov 22 '05 #1
2 1325
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.

--
Patrik Löwendahl [C# MVP]
cshrp.net - 'Elegant code by witty programmers'
cornerstone.se 'IT Training for professionals'

Julia wrote:
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

Nov 22 '05 #2
> 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/
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: KK | last post by:
Design Pattern help for this scenerio?. I need some expert advice on possible ways to design the classes for following scenerio. Subject domain has 3 types of identities. Lets say <IDType1>,...
2
by: Julia | last post by:
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...
2
by: thechaosengine | last post by:
Hi all, Does anyone know of a design pattern to deal with the issue of making UI controls active and inactive according to the context of what the user is doing? I've been thinking about the...
1
by: Tony Johansson | last post by:
Hello! I'm reading about design pattern adaptor in the GOF book and there is something that sounds strange. When you use the adaptor design pattern you have these participants. *Target -...
0
by: Tony Johansson | last post by:
Hello! I'm reading about design pattern adaptor in the GOF book and there is something that sounds strange. The text below each participant is the book explanation for each participant. I...
22
by: Krivenok Dmitry | last post by:
Hello All! I am trying to implement my own Design Patterns Library. I have read the following documentation about Observer Pattern: 1) Design Patterns by GoF Classic description of Observer....
3
by: Froefel | last post by:
I'm trying to modem a relationship with classes and I'm having trouble finding the correct design pattern. Maybe someone with more experience knows which pattern(s) I'm looking for. Here's an...
0
by: ryanmajarais | last post by:
Guys is there any one of you know the Design Pattern used in .net do u know some website that have a sample program using desing pattern in MVC Model View controller??? and Nhibernate.... using ...
3
by: Gav | last post by:
I have just started to rewrite my application using the Presenter First Design Pattern to make sure my business logic is not in the Gui itself. I've got the general idea but I'm a bit unsure as to...
3
by: guoqi zheng | last post by:
Any one know some good tutorial regarding design pattern which give example in vb.net code? Most of the code example I found are either c++ or java! regards, Guoqi Zheng...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.