K
Ken Allen
I am relatively new to .Net and C#, but I hav ebeen programing in other
languages and done some COM work for a number of years. I am attempting to
understand how to map an older program architecture into .Net -- not looking
to do it at this time, just to understand how I would achieve it.
In the old environment, we had two classes, a client and a server class,
that managed a data object. The server object knew how to interface with the
data store (a database) and it also contained the server-side business
processing logic for that object. The client object held a copy of the same
data and contained the client-side logic (including the business rules that
the front-side needed to understand in order to avoid too many trips to the
server). We used a generic factory that was a client-server class that knew
how to contruct both the client and server class objects and tie them
together (each client object contained a reference to the remote server
object). One of the more significant benefits of this approach was that only
one copy of the server side class object would exist for a specific entitiy
(say, a Customer record) regardless of the number of client class objects
(in different client computers -- within the same client application only
one instance exists for a specific record, regardless of the number of
references to that record) existed, and when the server object changed, the
changes were 'broadcasted' to all instances of the client object
automatically -- and the client side base class contained generic methods to
trigger udpates to the user interface when such changes were reported.
Actions invoked from the user interface were passed to the client class
instance, which sent these through the COM layers to the server class, which
then performed the work and reported the results, including any changes in
the data content, back to this and all other clients holding an instance of
the class object for that record.
I simply cannot see how to achieve this in .Net! I can see that there would
likely need to be three (3) -- if not four (4) -- classes defined: client
class, server class, common class, and possibly a factory or interface class
of some sort. What I cannot see is how I can have one instance of a specific
server class for a specific record, permit multiple client class instances
to exist for the same record, and have the client and server classes aware
of each other.
All of the books and documentation that I have accessed speak to the Web
Service model and make no reference of how to achieve any of the aspects of
this approach. I cannot even find a reference to how I might, from multiple
points in the client (user interface code) end up with multiple references
to the same instance of a class object for a specific record unless I
explicitly keep track of the instances myself (the old approach used the
concept of 'monikers' and did a lookup in the local 'dictionary' before
asking the server/factory to create a new instance for a specific record).
Is this approach even possible in .Net? Or is it possible but so incredibly
difficult to code that one may as well not bother? Or am I missing some
obvious aspects?
-Ken
languages and done some COM work for a number of years. I am attempting to
understand how to map an older program architecture into .Net -- not looking
to do it at this time, just to understand how I would achieve it.
In the old environment, we had two classes, a client and a server class,
that managed a data object. The server object knew how to interface with the
data store (a database) and it also contained the server-side business
processing logic for that object. The client object held a copy of the same
data and contained the client-side logic (including the business rules that
the front-side needed to understand in order to avoid too many trips to the
server). We used a generic factory that was a client-server class that knew
how to contruct both the client and server class objects and tie them
together (each client object contained a reference to the remote server
object). One of the more significant benefits of this approach was that only
one copy of the server side class object would exist for a specific entitiy
(say, a Customer record) regardless of the number of client class objects
(in different client computers -- within the same client application only
one instance exists for a specific record, regardless of the number of
references to that record) existed, and when the server object changed, the
changes were 'broadcasted' to all instances of the client object
automatically -- and the client side base class contained generic methods to
trigger udpates to the user interface when such changes were reported.
Actions invoked from the user interface were passed to the client class
instance, which sent these through the COM layers to the server class, which
then performed the work and reported the results, including any changes in
the data content, back to this and all other clients holding an instance of
the class object for that record.
I simply cannot see how to achieve this in .Net! I can see that there would
likely need to be three (3) -- if not four (4) -- classes defined: client
class, server class, common class, and possibly a factory or interface class
of some sort. What I cannot see is how I can have one instance of a specific
server class for a specific record, permit multiple client class instances
to exist for the same record, and have the client and server classes aware
of each other.
All of the books and documentation that I have accessed speak to the Web
Service model and make no reference of how to achieve any of the aspects of
this approach. I cannot even find a reference to how I might, from multiple
points in the client (user interface code) end up with multiple references
to the same instance of a class object for a specific record unless I
explicitly keep track of the instances myself (the old approach used the
concept of 'monikers' and did a lookup in the local 'dictionary' before
asking the server/factory to create a new instance for a specific record).
Is this approach even possible in .Net? Or is it possible but so incredibly
difficult to code that one may as well not bother? Or am I missing some
obvious aspects?
-Ken