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

Alternative to abstract classes w/ remoting.

I found a good tutorial of how to supply the objects without having
the implementation files on the client. This was working great until I
realized that I couldnt use any constructors with server activated
objects, so I switched to client activated objects only to run into
the next roadblock, doh! can't instantiate abstract classes... here is
a simple example of the structure, im sure there is a way to do it to
allow instantiation but I am not as knowledgeable of inheritance as I
should be:
namespace JLClient

{

public abstract class address : MarshalByRefObject

{

public abstract string foo{get;set;}

public abstract string test();

}

}

namespace JLBase

{

public class address : JLClient.address

{

public override string foo{get{return _foo;}set{_foo=value}}

public override string test()

{ return "blah"; }

private string _foo;

}

}
The client will only need to have the JLClient.dll for the structure
information and everything would work great... how do I do it without
using abstract classes and still having access to various
constructors?.
Jul 21 '05 #1
1 1795
Hi,

I am not sure if I understood the problem correctly. Please let me know if
I am wrong.

In the example you provide an interface definition will serve this purpose
better than abstract class.
I don't hink that it will be easy to operate an object created remotely
without reffering to any type. This possibility exists - there is late
binding technology in .Net. In C# you can use it via reflection API, in
Visual Basic the language can wrap everything for you.
You can access different constructors of a type without any type
information on the client via Activator.CreateInstance method. One of the
overloads take method name and the class name as strings. So, your client
part may really have no references to the type being created.
There is actually one restriction on the constructors: constructor
arguments should not have parameters passed by reference. If a class has
such constructor and you need tto call it, it makes sense to introduce
helper class that will play a role of object factory.

Hope this helps.

--
Victor Urnyshev [MSFT]
This post is "AS IS" with no warranties, and confers no rights.
--------------------
|From: sc***@veri-tax.com (f00sion)
|Newsgroups: microsoft.public.dotnet.general
|Subject: Alternative to abstract classes w/ remoting.
|Date: 25 Aug 2004 09:14:55 -0700
|Organization: http://groups.google.com
|Lines: 53
|Message-ID: <c8**************************@posting.google.com >
|NNTP-Posting-Host: 67.129.150.10
|Content-Type: text/plain; charset=ISO-8859-1
|Content-Transfer-Encoding: 8bit
|X-Trace: posting.google.com 1093450496 24481 127.0.0.1 (25 Aug 2004
16:14:56 GMT)
|X-Complaints-To: gr**********@google.com
|NNTP-Posting-Date: Wed, 25 Aug 2004 16:14:56 +0000 (UTC)
|Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!newsfeed00.s
ul.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!p
ostnews2.google.com!not-for-mail
|Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.general:143599
|X-Tomcat-NG: microsoft.public.dotnet.general
|
|I found a good tutorial of how to supply the objects without having
|the implementation files on the client. This was working great until I
|realized that I couldnt use any constructors with server activated
|objects, so I switched to client activated objects only to run into
|the next roadblock, doh! can't instantiate abstract classes... here is
|a simple example of the structure, im sure there is a way to do it to
|allow instantiation but I am not as knowledgeable of inheritance as I
|should be:
|
|
|namespace JLClient
|
|{
|
|public abstract class address : MarshalByRefObject
|
|{
|
|public abstract string foo{get;set;}
|
|public abstract string test();
|
|}
|
|}
|
|
|
|namespace JLBase
|
|{
|
|public class address : JLClient.address
|
|{
|
|public override string foo{get{return _foo;}set{_foo=value}}
|
|public override string test()
|
|{ return "blah"; }
|
|private string _foo;
|
|}
|
|}
|
|
|The client will only need to have the JLClient.dll for the structure
|information and everything would work great... how do I do it without
|using abstract classes and still having access to various
|constructors?.
|

Jul 21 '05 #2

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

Similar topics

62
by: christopher diggins | last post by:
Since nobody responded to my earlier post , I thought I would try to explain what I am doing a bit differently. When multiply inheriting pure virtual (abstract) base classes, a class obviously...
12
by: Daedalus.OS | last post by:
Ok first I'm pretty new to OOP, so my question may sound stupid to some of you. If the only answer you can provide is "get a book about OOP" then don't loose your time and mine cause it's already...
10
by: Michael Culley | last post by:
In vb6 it was possible to create an exe as an activeX exe and communicate between 2 apps. Now we have remoting which requires opening a tcp port to listen on, which seems kinda crappy cause another...
2
by: Dave Veeneman | last post by:
Is is legal to declare abstract members in non-abstract classes? How about non-abstract members in abstract classes? I am writing a base class with three derived classes. The base class will...
7
by: Brett | last post by:
I have created an interface with five properties and five methods. Five classes are accessed through this interface and contain the implementation. This setup works fine now. All the classes are...
9
by: Sean Kirkpatrick | last post by:
To my eye, there doesn't seem to be a whole lot of difference between the two of them from a functional point of view. Can someone give me a good explanation of why one vs the other? Sean
2
by: f00sion | last post by:
I found a good tutorial of how to supply the objects without having the implementation files on the client. This was working great until I realized that I couldnt use any constructors with server...
7
by: jason | last post by:
In the microsoft starter kit Time Tracker application, the data access layer code consist of three cs files. DataAccessHelper.cs DataAcess.cs SQLDataAccessLayer.cs DataAcccessHelper appears...
0
by: emin.shopper | last post by:
I had a need recently to check if my subclasses properly implemented the desired interface and wished that I could use something like an abstract base class in python. After reading up on metaclass...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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
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...

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.