473,779 Members | 2,041 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Architecture, entity states, the meaning of life?

Hi,

I've been working on designing new architecture to be
used for future development using C#.

We're going quite well with the architecture, having
originally decided not to use the dataset, datatable,
dataadapter type implementation. Instead we are using
our own implementation using business entities,
controlling processes, etc., so we have definite
business, data and presentation layers. We're happy with
this, but the further on we go, the more out
implementation seems like an alternative version of the
dataset. What I'd like to know is how does the dataset
compare to other implementations for large distributed
systems, as well as small desktop ones?

Part of the architecture would involve having the
business entities (the classes containing the data)
having their own internal representation of state
(unchanged, insert, update, delete) Any thoughts on how
this might be accomplished? I had a thought that be
could call a set method from a base class that would
compare, and set the values in they're different, and
also manage the state information. However, that becomes
a problem when trying to pass a property as a ref value.
Any ideas on how else this might be accomplished, or
should we just get the users of the subsystems to set the
mode manually (not my preference)
It would be great with the above to be able to override
how the set part of a property works, so we can always
make the property perform a check and keep internal state
up to date, but there seems no way of doing this that I
can find.

There must be a simple way of doing this - I can't be the
first person to have this problem, surely!

Any thoughts, suggestions, etc. would be gladly accepted.

Cheers,

Martin.
Nov 15 '05 #1
2 1523
"Martin Platt" <ma**********@h cn.com.au> wrote in message
news:04******** *************** *****@phx.gbl.. .
Hi,

I've been working on designing new architecture to be
used for future development using C#.
Hm. Well, why do so many people do this? No wonder the jobs go to india :-)
We're going quite well with the architecture, having
originally decided not to use the dataset, datatable,
dataadapter type implementation. Instead we are using
our own implementation using business entities,
controlling processes, etc., so we have definite
business, data and presentation layers. We're happy with
Well, but do you do everything right? Sorry to ask, but I work on this as a
product for about 4 man years now, and we are just getting the second
iteration to our customers. This is a HUGH undertaking when you want to do
it right.
this, but the further on we go, the more out
implementation seems like an alternative version of the
dataset. What I'd like to know is how does the dataset
Sounds like you have an architectural fudge here. It should not.
compare to other implementations for large distributed
systems, as well as small desktop ones?
Well, some like it, some dont. Mostly the ones which like architeture do not
like it.
Part of the architecture would involve having the
business entities (the classes containing the data)
having their own internal representation of state
(unchanged, insert, update, delete) Any thoughts on how
this might be accomplished? I had a thought that be
Yes, tons of - I did one year of research on this. Try looking up O/R
mapping papers on the net, like from Scott Ambler
(http://www.ambysoft.com/).
could call a set method from a base class that would
compare, and set the values in they're different, and
also manage the state information. However, that becomes
Sort of :-) Our implementation in the EntityBroker (propably way cheaper to
buy than do roll your own) has all data in a hidden data container that does
all the checks.
a problem when trying to pass a property as a ref value.
You should never ever do this. This is a broken design per definition.
Properties should never return refs (is this even possible?) as this would
bypass the set logic. The can return references to classes, but then the
class would also be a busienss object and have the logic.
Any ideas on how else this might be accomplished, or
should we just get the users of the subsystems to set the
mode manually (not my preference)
Nope. Read design papers on busienss object frameworks, there are a ton in
the java world.
It would be great with the above to be able to override
how the set part of a property works, so we can always
make the property perform a check and keep internal state
up to date, but there seems no way of doing this that I
can find.
There is. You could go to our website and have a look at our EntityBroker
2003.0, get a trial license and read the documentation. This should give you
some ideas.

We work with abstract poperties for which we emit subclasses (with
implementing bytecode) at program start.

Another way (2003.1, next version) is a code generator generating the
properties in a stub base class from which the real business object inherits
and just verrides the logic.
There must be a simple way of doing this - I can't be the
first person to have this problem, surely!


Really? You SHOULD not solve it but go out and see whether there is a tool
for this. Otherwise ou waste your companie's ressources. You would not start
coding a grid either, or? SOme compaines (like ours) specialize on providing
exactly the layer you seem to strive for.

--
Regards

Thomas Tomiczek
THONA Software & Consulting Ltd.
(Microsoft MVP C#/.NET)
Nov 15 '05 #2
Although I agree with the excellent response from Thomas Tomicek, I still
think that using third party tools can be problematic, the DataSet being a
good example.

I have a few additions to what he said. Mainly

Read Martin Fowler's "Patterns of Enterprise Application Architecture"
http://www.amazon.com/exec/obidos/AS...852016-8379852

how does the dataset compare to other implementations for large distributed
systems, as well as small desktop ones?
For what it's worth I found the DataSet bloated and rigid. I think it was
one of Microsoft's compromises to RAD developers.

Part of the architecture would involve having the
business entities (the classes containing the data)
having their own internal representation of state
(unchanged, insert, update, delete) Any thoughts on how
this might be accomplished?
One way, which I am looking into now, is the aspect-oriented programming
(AOP) approach. Things like transactions, security, concurrency and logging
muddy the code in the business objects. At present AOP can be implemented in
C# using ContextBoundObj ect descendants and MessageSinks to intercept calls.
I haven't started trying to implement this yet. It's pretty deep. I have
also heard that ContextBoundObj ect carries a performance penalty.

It would be great with the above to be able to override
how the set part of a property works, so we can always
make the property perform a check and keep internal state
up to date, but there seems no way of doing this that I
can find.


You could put code in each and every set method of each property of the
business object. This code would register the object with a "UnitOfWork "
(see Fowler). Then let the UnitOfWork take care of applying business rules,
transactions, calls to the DataAccess or Persistence Layer etc. The problem
here, and I haven't found a way around it, is having to put the same code in
every set method. The business objects should not have to worry about this
kind of plumbing.
Robert Zurer
Nov 15 '05 #3

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

Similar topics

11
2394
by: Douglas Reith | last post by:
Hi There, Can someone please tell me why the XML spec states that an attribute value with an external entity is forbidden? Or point me to the appropriate document? Or better still, perhaps you know of a work around? It is a little frustrating that the normally powerful external entities are limited in this fashion. Example (myextent.txt contains just one word without a CR):
0
2395
by: Jimmy Cerra | last post by:
Note: I'm a little unsure if this is the appropiate place to discuss the TAG document, "Architecture of the World Wide Web" . If not, please direct me to the appropiate forum. I can be contacted at jimbomaps @ hotmail.com (remove the spaces from my email address). Now to the topic at hand. Tim Bray recently discussed the TAG document at his weblog . I am a little confused after reading section 2.3, "URI Authority" . Does the text...
25
5627
by: David Noble | last post by:
We've been developing a web site using 3-tier architecture for 18 months now. There is a common layer that defines the classes - using XML schemas. The data layer acts as a wrapper to 3 databases - SQL Server, Oracle and AS400. The business layer exposes web services which communicate with the front end, ASP.Net. All 3 tiers are on different boxes. This works well. Now I am leading a team to build a winforms app. I need some advice as
5
2327
by: Stephan Hoffmann | last post by:
Hi, I use XML mainly as a source for HTML. HTML browsers 'know' certain entity references like &eacute; or &auml;. When I use XSL to transform XML to HTML or XML, these entities are replaced by what they refer to. Is there a way to avoid that?
19
2115
by: James Harris | last post by:
My K&R 2nd ed has in the Reference Manual appendix, A7.4.8 sizeof yields the number of BYTES required to store an object of the type of its operand. What happens if C is running on a machine that addresses larger words only? Shouldn't sizeof be defined to return the smallest number of 'storage units' required to store an object of the type of its operand? As a general point, is there a guide to what aspects of C would fail if run on a...
41
4735
by: laimis | last post by:
Hey guys, I just recently got introduced to data mappers (DTO mapper). So now I have a SqlHelper being used by DTOMapper and then business layer is using DTOMapper when it needs to persist object to database or load them back. Everything is working nicely so far. My question is, is it OK practice to use DTOMapper rfom the presentation layer? For instance, if I want to present in HTML format the list of entries in my database, should I...
2
2098
by: Silent Ocean | last post by:
Hi 1. I am in process of designing N-Tier Application using ASP.NET. Can anyone guide me the right material or microsoft guidelines document which I can used in designing the N-Tier application. 2. I would also like to know whether to use Web Services or .Net Remoting in designing N-Tier application 3. General 3 Tier architecture has 3 Tier : Presentation Layer , Business Layer and Database Layer
6
2078
by: Tuomas Rannikko | last post by:
Hello, I'm currently writing a XML processor for the fun of it. There is something I don't understand in the spec though. I'm obviously missing something important. The spec states that both Internal General and Character references are included when referenced in content. And "included" means: <quote>
1
1379
by: Cirene | last post by:
Do you have any good book recommendations for learning Entity Framework, DAAB, and/or Tiered Architecture (business objects, etc)? I am a VB.net developer, but C# would be ok I guess.... Thanks
0
9636
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
1
10074
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9930
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8961
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7485
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6724
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5373
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4037
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 we have to send another system
3
2869
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.