473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 16 '05 #1
2 1322
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 16 '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 16 '05 #3

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

Similar topics

2
by: Tony Marston | last post by:
For those who you thought my method of implementing OO principles in PHP was totally wrong - see http://www.tonymarston.co.uk/php-mysql/good-bad-oop.html for details, you can now read...
13
by: Mike Sutton | last post by:
I had first tried a less active PHP group, but let me try here. I searched for this, but didn't find anything that appeared related. Possibly I didn't know what to search for. I am designing a...
13
by: Droolboy | last post by:
I'm trying to build a fairly small (max. 10 different pages) site using php, and it's becoming obvious that I need some kind of model view separation. Having done a few searches, I've come...
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...
0
by: Steven Kelly | last post by:
For those going to XP 2005 (Sheffield, UK, June 18-23) and interested in modeling, the following workshop may be of interest: Agile Development with Domain Specific Languages Scaling up Agile -...
1
by: Earl Teigrob | last post by:
Background: When I create a ASP.NET control (User or custom), it often requires security to be set for certain functionality with the control. For example, a news release user control that is...
2
by: Tinu | last post by:
Hi, I have some kind of basic-design question. While developing my web application I asked myself if it makes sense to use some kind of command pattern. How do others implement the functional...
12
by: Doug | last post by:
Hi, I learned a little about the model view presenter pattern at a conference this last week and am experimenting with it. It's working pretty well but I have a question. I am trying to use...
9
by: Marc De Schrijver | last post by:
I'm designing an OO Model for a large application, and I have some question on how to model a particular situation; it's not directly related to C# but rather to general OO. The applicaiton will be...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.