473,396 Members | 1,836 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,396 software developers and data experts.

interface / inheritance?

hi,

I have a scenario where I would like to create a windows application and
using a class to return a message so that it can be displayed on the windows
application when a button is clicked.

After that is done, I would compile and package the windows application and
class for customer.

WIthout have to provide the source code of the windows application and class
file, how can the customer easily create a new class that implement the
compiled class to add more features such as displaying another message when
the button on the windows application is clicked? The previous message that
implemented in the compiled class should also be displayed and should not be
overrided.

How would this be implemented? Appreciate if this can be explained in simple
code.

THanks,
C# Newbie
Nov 16 '05 #1
1 1049
Take a look at the Decorator pattern or the Chain of Responsibility pattern
in the Gang of Four patterns.

http://www.dofactory.com/Patterns/Patterns.aspx

You will also need to look at one of the creational patterns so that you can
set up the structure correctly. (Perhaps Builder).

I suppose, if you are not going to provide the source code for the calling
side, you will want to provide the capability for the user to provide the
name of a class to call in the config file. Then your code can simply call
any classes that the user defines that meet your interface criteria and
which interact in the chosen pattern in the way you've defined.

See Assembly.Load
http://msdn.microsoft.com/library/de...sLoadTopic.asp

Hope this helps,

--- Nick
"C# Newbie" <C# Ne****@discussions.microsoft.com> wrote in message
news:B8**********************************@microsof t.com...
hi,

I have a scenario where I would like to create a windows application and
using a class to return a message so that it can be displayed on the windows application when a button is clicked.

After that is done, I would compile and package the windows application and class for customer.

WIthout have to provide the source code of the windows application and class file, how can the customer easily create a new class that implement the
compiled class to add more features such as displaying another message when the button on the windows application is clicked? The previous message that implemented in the compiled class should also be displayed and should not be overrided.

How would this be implemented? Appreciate if this can be explained in simple code.

THanks,
C# Newbie

Nov 16 '05 #2

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

Similar topics

9
by: Tom Evans | last post by:
My basic question: If I have a specific interface which I know is going to be implemented by a number of classes, but there is no implementation commonality between them, what is the preferred...
4
by: Roy Pereira | last post by:
I have an application that is composed of a set of "Content" dlls and a viewer application. The viewer calls a standard set of functions that are present in all the dlls. I maintain this by...
4
by: christopher diggins | last post by:
A feature that I find signficantly missing in C# is the ability to write functions in interfaces that can call other functions of the interface. Given an interface ISomeInteface the only way we can...
21
by: Helge Jensen | last post by:
I've got some data that has Set structure, that is membership, insert and delete is fast (O(1), hashing). I can't find a System.Collections interface that matches the operations naturally offered...
7
by: Hazz | last post by:
Are there any good references/articles/books which provide clarity toward my insecurity still on deciding how to model a complex system? I still feel uncomfortable with my understanding, even...
10
by: Brett | last post by:
I'm still trying to figure out concrete reasons to use one over the other. I understand the abstract class can have implementation in its methods and derived classes can only inherit one abstract...
6
by: John Salerno | last post by:
I understand how they work (basically), but I think maybe the examples I'm reading are too elementary to really show their value. Here's one from Programming C#: #region Using directives ...
12
by: Meya-awe | last post by:
I am puzzled, what is the purpose of an interface? How does it work, what i mean is how does the compiler treats this? Why when we talk about separating user interface from business logic, an...
4
by: Raja Chandrasekaran | last post by:
Hai friends, I really wonder, If the interface does not have any definition, Y do we need to use interface. You can then only we can use Multiple inheritance. I really cant understand, Just for...
52
by: Ben Voigt [C++ MVP] | last post by:
I get C:\Programming\LTM\devtools\UselessJunkForDissassembly\Class1.cs(360,27): error CS0535: 'UselessJunkForDissassembly.InvocableInternals' does not implement interface member...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.