473,763 Members | 4,584 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OOD/OOP and databases

Hello

I've been reading a lot of great OOD/OOP books lately (e.g.. Martin Fowlers
UML Distilled, Patterns of Enterprise Application Architecture, Refactoring,
Kent Becks's Test Driven Development, and also a book called Design Patterns
Explained.)... al of them with the focus on Java, because I think the best
books are targeted Java. But the all fit very well to the .NET platform.

I have one big problem when reading these great books, and that is that they
focus almost entirely on the Domain Model (that is the Middle Layer in a 3
layered architecture). They hardly mention that the code you write is to be
used in a UI interface and committed to a database ([PoEAA] might be an
exception). I find the separation of Business Login and UI to be the hardest
thing. And also I find the performance issues when talking to the Database
to a very tricky thing, that calls for a few hack in the Domain Layer (I'm
almost only doing thick clients... that is no web).

So I would like to know how you OO Guys really work (references to books or
articles would be great).

Don't you design your database the same way that you design you Business
Model if you are responsible for all 3 layers/tiers?

How much time does you spend on writing the DAL (the mapping between the OO
and the Database)? Do you use any kind of O/R Mappers to help you write the
DAL?

Where do you place the tiers in a Smart Client configuration? The way I see
it the UI and Domain Model must be on the client. Because you Domain Model
contains a lot of information e.g. about validation the input, and I don't
want a Server Round Trip every time the users enters something in a textbox.
But I'm also thinking about putting the same domain objects on the server
aswell and use some kind of serialization using .NET Remoting or Web
Services. Anyone else placing the Domain Model on both the Client and
Server?

Can you recommend any third party frameworks, which addresses any of these
problems? I find many of the MS Reference application to be to exotic.

I know these are big questions for a thread in a newsgroup... but never the
less, I haven't found any books or articles that really deals with these
issues.

Best regards,
Thomas
MCSD, MCSE+I, MCP+SB
Jul 21 '05 #1
5 1837
Yes... that's a lot for a newsgroup.

Start here:
http://www.microsoft.com/resources/p...s/default.mspx

I, too, have read many of the same books. You didn't mention the Design
Patterns book itself (Gang of Four: Gamma, Helm, Johnson, and Vlissides) but
it, too, is an excellent volume. There are also a number of patterns books
that describe code in C# that have been coming out in the past two years.

The books do not focus on a particular tier. The Design Patterns books,
specifically, focus on a specific level of abstraction. The Fowler book
focuses on a different level of abstraction. Buschmann takes on the
architectural level. Honestly, to answer your questions, Buschmann is the
best of the group.

The Microsoft site has some very specific advice for the .NET platform with
regards to optimizations.. . worth looking into.

As for me: my middle tier is normally tailored to one thing: hiding the
business rules. That requires real analysis: what are the business rules...
what will change... how will they change... how will we maintain them.

Config files are not good for business rule changes... they are too
tactical. You can change the name of a stored proc in the config file. To
change the business rules, you need to encapsulate logic, not just
constants. Using pluggable components will only get you so far.

So, if the business layer has very few business rules, it's really thin.
For many purposes, especially for domain tables (lookup tables), I don't
have any logic at all in the middle tier. In that case, I often simply pass
the data through directly from the DAL to the UI layer as an array of
DataRows. I'll even occasionally bind directly to a control (not often, but
for drop-downs, it's good). On the other hand, if the business layer has
business rules to encapsulate, then I will organize the objects so that
managing those rules makes sense. This is where we start to deviate from
"business objects that mirror the database". This is where the design
patterns come in handy. You really have to map your data into objects that
isolate change and minimize complexity.

I've yet to find a tool or framework that does more than simply
copy-and-reflect operations from the database through the middle tier. I
don't use them. WHat a massive waste of time and processing power. Heck...
the DataSet object does a better job than most of these, and it doesn't
require a huge amount of effort to use! (I don't use it either... I'm just
making a point).

As for copying the validation rules: For a thick client app, I'd have the
same validation dll on both the client and the server. That way, you can
insure common rules. Note: business rules are much more than validation.
I'd have basic validation types that I can use in both places, but the rest
of the rules are quite different.

As for use of remoting: depends on the kind and style of scalability you
want to achieve. For my preference, remoting is too tightly coupled for the
kinds of things that I do... I tend toward web services... but that may not
be advice that you can use... depends on your app.

I hope this info is helpful.
--- Nick Malik
Application Architect
MCSD, CFPS, Certified Scrummaster
"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:ec******** ********@TK2MSF TNGP14.phx.gbl. ..
Hello

I've been reading a lot of great OOD/OOP books lately (e.g.. Martin Fowlers UML Distilled, Patterns of Enterprise Application Architecture, Refactoring, Kent Becks's Test Driven Development, and also a book called Design Patterns Explained.)... al of them with the focus on Java, because I think the best
books are targeted Java. But the all fit very well to the .NET platform.

I have one big problem when reading these great books, and that is that they focus almost entirely on the Domain Model (that is the Middle Layer in a 3
layered architecture). They hardly mention that the code you write is to be used in a UI interface and committed to a database ([PoEAA] might be an
exception). I find the separation of Business Login and UI to be the hardest thing. And also I find the performance issues when talking to the Database
to a very tricky thing, that calls for a few hack in the Domain Layer (I'm
almost only doing thick clients... that is no web).

So I would like to know how you OO Guys really work (references to books or articles would be great).

Don't you design your database the same way that you design you Business
Model if you are responsible for all 3 layers/tiers?

How much time does you spend on writing the DAL (the mapping between the OO and the Database)? Do you use any kind of O/R Mappers to help you write the DAL?

Where do you place the tiers in a Smart Client configuration? The way I see it the UI and Domain Model must be on the client. Because you Domain Model
contains a lot of information e.g. about validation the input, and I don't
want a Server Round Trip every time the users enters something in a textbox. But I'm also thinking about putting the same domain objects on the server
aswell and use some kind of serialization using .NET Remoting or Web
Services. Anyone else placing the Domain Model on both the Client and
Server?

Can you recommend any third party frameworks, which addresses any of these
problems? I find many of the MS Reference application to be to exotic.

I know these are big questions for a thread in a newsgroup... but never the less, I haven't found any books or articles that really deals with these
issues.

Best regards,
Thomas
MCSD, MCSE+I, MCP+SB

Jul 21 '05 #2
Thomas,
I would consider a Table Module & Table Data Gateway approach if my "Domain
objects" did not have any real logic to them. See
http://www.martinfowler.com/eaaCatalog/tableModule.html &
http://www.martinfowler.com/eaaCatal...taGateway.html patterns. I
consider DataSets (both typed & untyped) to be ideal for implementing Table
Module & Table Data Gateways.

However if my "Domain Objects" had heavy logic to them, then I would use a
Domain Model and Data Mapper approach. See:
http://www.martinfowler.com/eaaCatalog/domainModel.html &
http://www.martinfowler.com/eaaCatalog/dataMapper.html patterns.
Don't you design your database the same way that you design you Business
Model if you are responsible for all 3 layers/tiers? I don't (at least I attempt not to) when using a Domain Model, although they
may be close. Martin's PoEAA has a number of patterns useful here.

However! with Table Module they tend to work out that way.
How much time does you spend on writing the DAL (the mapping between the
OO
and the Database)? Do you use any kind of O/R Mappers to help you write
the
DAL? I have not used an O/R mapper yet.

Can you recommend any third party frameworks, which addresses any of these
problems? I find many of the MS Reference application to be to exotic.
Rockford Lhotka's book "Expert One-on-One Visual Basic .NET Business
Objects" from A! Press provides a pre-implemented variation of Fowler's
Domain Model & Data Mapper patterns. See CSLA.NET at:
http://www.lhotka.net/

Services. Anyone else placing the Domain Model on both the Client and
Server? Lhotka's CSLA.NET is leverages .NET remoting if you choose to use it.
Hope this helps
Jay
"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:ec******** ********@TK2MSF TNGP14.phx.gbl. .. Hello

I've been reading a lot of great OOD/OOP books lately (e.g.. Martin
Fowlers
UML Distilled, Patterns of Enterprise Application Architecture,
Refactoring,
Kent Becks's Test Driven Development, and also a book called Design
Patterns
Explained.)... al of them with the focus on Java, because I think the best
books are targeted Java. But the all fit very well to the .NET platform.

I have one big problem when reading these great books, and that is that
they
focus almost entirely on the Domain Model (that is the Middle Layer in a 3
layered architecture). They hardly mention that the code you write is to
be
used in a UI interface and committed to a database ([PoEAA] might be an
exception). I find the separation of Business Login and UI to be the
hardest
thing. And also I find the performance issues when talking to the Database
to a very tricky thing, that calls for a few hack in the Domain Layer (I'm
almost only doing thick clients... that is no web).

So I would like to know how you OO Guys really work (references to books
or
articles would be great).

Don't you design your database the same way that you design you Business
Model if you are responsible for all 3 layers/tiers?

How much time does you spend on writing the DAL (the mapping between the
OO
and the Database)? Do you use any kind of O/R Mappers to help you write
the
DAL?

Where do you place the tiers in a Smart Client configuration? The way I
see
it the UI and Domain Model must be on the client. Because you Domain Model
contains a lot of information e.g. about validation the input, and I don't
want a Server Round Trip every time the users enters something in a
textbox.
But I'm also thinking about putting the same domain objects on the server
aswell and use some kind of serialization using .NET Remoting or Web
Services. Anyone else placing the Domain Model on both the Client and
Server?

Can you recommend any third party frameworks, which addresses any of these
problems? I find many of the MS Reference application to be to exotic.

I know these are big questions for a thread in a newsgroup... but never
the
less, I haven't found any books or articles that really deals with these
issues.

Best regards,
Thomas
MCSD, MCSE+I, MCP+SB

Jul 21 '05 #3
Hello Nick

Thanks for you input.

First... Yes, you are right, I haven't read the GoF book yet. I thought I
start with something a bit lighter which Design Patterns Explained was (a
great introduction to OOD though). Is it readable for a .NET guy?

Buschmann... never heard of him (embarrassed smiley here). I took a look on
Amazon... can you recommend a specific book?

I read a lot from the Microsoft Patterns & Practices group. I like the
Application Blocks, although I don't really see them as a design guide....
they are just... well Application Blocks.

Regarding my problem about separating the Business and the UI. I agree that
business rules is much more than validation. But I often find that all kind
of rules are need in the UI. E.g. which menu items is shown, warnings and
other things to make sure that exceptions doesn't occurs when calling the
Domain Model. This might sound odd, but e.g. I might have a rule that I
can't call Customer.AddCon tactInformation , if the customer is inactive or
unsaved. So I'd make a Property on the Customer called
AddContactInfor mationAllowed. I use this property to decide whether a
certain menu option is available, and/or I call this before
AddContactInfor mation, to make sure that it doesn't throw an exception.

For me this kind of interaction is a must to make a usable client
application (which is what's count in the end... at least for me), but I
don't se much of this kind in the OO books. But I will consider splitting up
the Domain Model in two (on for validation like things, and one for hiding
business rules)... I'm just not quit sure that this is doable, if related
responsibilitie s is to be grouped on the same object.

Thomas

"Nick Malik" <ni*******@hotm ail.nospam.com> wrote in message
news:7MG0d.4177 94$%_6.111013@a ttbi_s01...
Yes... that's a lot for a newsgroup.

Start here:
http://www.microsoft.com/resources/p...s/default.mspx

I, too, have read many of the same books. You didn't mention the Design
Patterns book itself (Gang of Four: Gamma, Helm, Johnson, and Vlissides) but it, too, is an excellent volume. There are also a number of patterns books that describe code in C# that have been coming out in the past two years.

The books do not focus on a particular tier. The Design Patterns books,
specifically, focus on a specific level of abstraction. The Fowler book
focuses on a different level of abstraction. Buschmann takes on the
architectural level. Honestly, to answer your questions, Buschmann is the
best of the group.

The Microsoft site has some very specific advice for the .NET platform with regards to optimizations.. . worth looking into.

As for me: my middle tier is normally tailored to one thing: hiding the
business rules. That requires real analysis: what are the business rules... what will change... how will they change... how will we maintain them.

Config files are not good for business rule changes... they are too
tactical. You can change the name of a stored proc in the config file. To change the business rules, you need to encapsulate logic, not just
constants. Using pluggable components will only get you so far.

So, if the business layer has very few business rules, it's really thin.
For many purposes, especially for domain tables (lookup tables), I don't
have any logic at all in the middle tier. In that case, I often simply pass the data through directly from the DAL to the UI layer as an array of
DataRows. I'll even occasionally bind directly to a control (not often, but for drop-downs, it's good). On the other hand, if the business layer has
business rules to encapsulate, then I will organize the objects so that
managing those rules makes sense. This is where we start to deviate from
"business objects that mirror the database". This is where the design
patterns come in handy. You really have to map your data into objects that isolate change and minimize complexity.

I've yet to find a tool or framework that does more than simply
copy-and-reflect operations from the database through the middle tier. I
don't use them. WHat a massive waste of time and processing power. Heck... the DataSet object does a better job than most of these, and it doesn't
require a huge amount of effort to use! (I don't use it either... I'm just making a point).

As for copying the validation rules: For a thick client app, I'd have the
same validation dll on both the client and the server. That way, you can
insure common rules. Note: business rules are much more than validation.
I'd have basic validation types that I can use in both places, but the rest of the rules are quite different.

As for use of remoting: depends on the kind and style of scalability you
want to achieve. For my preference, remoting is too tightly coupled for the kinds of things that I do... I tend toward web services... but that may not be advice that you can use... depends on your app.

I hope this info is helpful.
--- Nick Malik
Application Architect
MCSD, CFPS, Certified Scrummaster
"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:ec******** ********@TK2MSF TNGP14.phx.gbl. ..
Hello

I've been reading a lot of great OOD/OOP books lately (e.g.. Martin

Fowlers
UML Distilled, Patterns of Enterprise Application Architecture,

Refactoring,
Kent Becks's Test Driven Development, and also a book called Design

Patterns
Explained.)... al of them with the focus on Java, because I think the best books are targeted Java. But the all fit very well to the .NET platform.

I have one big problem when reading these great books, and that is that

they
focus almost entirely on the Domain Model (that is the Middle Layer in a 3 layered architecture). They hardly mention that the code you write is to

be
used in a UI interface and committed to a database ([PoEAA] might be an
exception). I find the separation of Business Login and UI to be the

hardest
thing. And also I find the performance issues when talking to the Database to a very tricky thing, that calls for a few hack in the Domain Layer (I'm almost only doing thick clients... that is no web).

So I would like to know how you OO Guys really work (references to books

or
articles would be great).

Don't you design your database the same way that you design you Business
Model if you are responsible for all 3 layers/tiers?

How much time does you spend on writing the DAL (the mapping between the

OO
and the Database)? Do you use any kind of O/R Mappers to help you write

the
DAL?

Where do you place the tiers in a Smart Client configuration? The way I

see
it the UI and Domain Model must be on the client. Because you Domain Model contains a lot of information e.g. about validation the input, and I don't want a Server Round Trip every time the users enters something in a

textbox.
But I'm also thinking about putting the same domain objects on the server aswell and use some kind of serialization using .NET Remoting or Web
Services. Anyone else placing the Domain Model on both the Client and
Server?

Can you recommend any third party frameworks, which addresses any of these problems? I find many of the MS Reference application to be to exotic.

I know these are big questions for a thread in a newsgroup... but never

the
less, I haven't found any books or articles that really deals with these
issues.

Best regards,
Thomas
MCSD, MCSE+I, MCP+SB


Jul 21 '05 #4
Thomas,
I would recommend Joshua Kerievsky's book "Refactorin g to Patterns" by
Addison-Wesley.

In stead of a AddContactInfor mationAllowed property I would consider
implementing some form of Self-Evaluating Rule. Where the domain object
offers the UI a collection or composite of Self-Evaluating Rules that
indicate to the UI what is or is not allowed. This allows the UI to easily
validate against the domain object without the domain object raising
exceptions. Also its allows the UI to be one step further decoupled from the
domain. If I went the Self-Evaluating Rule approach I would consider making
controls that are Self-Evaluating Rule aware...

Self-Evaluating Rule are defined by David West in his book "Object Thinking"
from MS Press.

Hope this helps
Jay

"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:eT******** ******@TK2MSFTN GP11.phx.gbl...
Hello Nick

Thanks for you input.

First... Yes, you are right, I haven't read the GoF book yet. I thought I
start with something a bit lighter which Design Patterns Explained was (a
great introduction to OOD though). Is it readable for a .NET guy?

Buschmann... never heard of him (embarrassed smiley here). I took a look
on
Amazon... can you recommend a specific book?

I read a lot from the Microsoft Patterns & Practices group. I like the
Application Blocks, although I don't really see them as a design guide....
they are just... well Application Blocks.

Regarding my problem about separating the Business and the UI. I agree
that
business rules is much more than validation. But I often find that all
kind
of rules are need in the UI. E.g. which menu items is shown, warnings and
other things to make sure that exceptions doesn't occurs when calling the
Domain Model. This might sound odd, but e.g. I might have a rule that I
can't call Customer.AddCon tactInformation , if the customer is inactive or
unsaved. So I'd make a Property on the Customer called
AddContactInfor mationAllowed. I use this property to decide whether a
certain menu option is available, and/or I call this before
AddContactInfor mation, to make sure that it doesn't throw an exception.

For me this kind of interaction is a must to make a usable client
application (which is what's count in the end... at least for me), but I
don't se much of this kind in the OO books. But I will consider splitting
up
the Domain Model in two (on for validation like things, and one for hiding
business rules)... I'm just not quit sure that this is doable, if related
responsibilitie s is to be grouped on the same object.

Thomas

"Nick Malik" <ni*******@hotm ail.nospam.com> wrote in message
news:7MG0d.4177 94$%_6.111013@a ttbi_s01...
Yes... that's a lot for a newsgroup.

Start here:
http://www.microsoft.com/resources/p...s/default.mspx

I, too, have read many of the same books. You didn't mention the Design
Patterns book itself (Gang of Four: Gamma, Helm, Johnson, and Vlissides)

but
it, too, is an excellent volume. There are also a number of patterns

books
that describe code in C# that have been coming out in the past two years.

The books do not focus on a particular tier. The Design Patterns books,
specifically, focus on a specific level of abstraction. The Fowler book
focuses on a different level of abstraction. Buschmann takes on the
architectural level. Honestly, to answer your questions, Buschmann is
the
best of the group.

The Microsoft site has some very specific advice for the .NET platform

with
regards to optimizations.. . worth looking into.

As for me: my middle tier is normally tailored to one thing: hiding the
business rules. That requires real analysis: what are the business

rules...
what will change... how will they change... how will we maintain them.

Config files are not good for business rule changes... they are too
tactical. You can change the name of a stored proc in the config file.

To
change the business rules, you need to encapsulate logic, not just
constants. Using pluggable components will only get you so far.

So, if the business layer has very few business rules, it's really thin.
For many purposes, especially for domain tables (lookup tables), I don't
have any logic at all in the middle tier. In that case, I often simply

pass
the data through directly from the DAL to the UI layer as an array of
DataRows. I'll even occasionally bind directly to a control (not often,

but
for drop-downs, it's good). On the other hand, if the business layer has
business rules to encapsulate, then I will organize the objects so that
managing those rules makes sense. This is where we start to deviate from
"business objects that mirror the database". This is where the design
patterns come in handy. You really have to map your data into objects

that
isolate change and minimize complexity.

I've yet to find a tool or framework that does more than simply
copy-and-reflect operations from the database through the middle tier. I
don't use them. WHat a massive waste of time and processing power.

Heck...
the DataSet object does a better job than most of these, and it doesn't
require a huge amount of effort to use! (I don't use it either... I'm

just
making a point).

As for copying the validation rules: For a thick client app, I'd have the
same validation dll on both the client and the server. That way, you can
insure common rules. Note: business rules are much more than validation.
I'd have basic validation types that I can use in both places, but the

rest
of the rules are quite different.

As for use of remoting: depends on the kind and style of scalability you
want to achieve. For my preference, remoting is too tightly coupled for

the
kinds of things that I do... I tend toward web services... but that may

not
be advice that you can use... depends on your app.

I hope this info is helpful.
--- Nick Malik
Application Architect
MCSD, CFPS, Certified Scrummaster
"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:ec******** ********@TK2MSF TNGP14.phx.gbl. ..
> Hello
>
> I've been reading a lot of great OOD/OOP books lately (e.g.. Martin

Fowlers
> UML Distilled, Patterns of Enterprise Application Architecture,

Refactoring,
> Kent Becks's Test Driven Development, and also a book called Design

Patterns
> Explained.)... al of them with the focus on Java, because I think the best > books are targeted Java. But the all fit very well to the .NET
> platform.
>
> I have one big problem when reading these great books, and that is that

they
> focus almost entirely on the Domain Model (that is the Middle Layer in
> a 3 > layered architecture). They hardly mention that the code you write is
> to

be
> used in a UI interface and committed to a database ([PoEAA] might be an
> exception). I find the separation of Business Login and UI to be the

hardest
> thing. And also I find the performance issues when talking to the Database > to a very tricky thing, that calls for a few hack in the Domain Layer (I'm > almost only doing thick clients... that is no web).
>
> So I would like to know how you OO Guys really work (references to
> books

or
> articles would be great).
>
> Don't you design your database the same way that you design you
> Business
> Model if you are responsible for all 3 layers/tiers?
>
> How much time does you spend on writing the DAL (the mapping between
> the

OO
> and the Database)? Do you use any kind of O/R Mappers to help you write

the
> DAL?
>
> Where do you place the tiers in a Smart Client configuration? The way I

see
> it the UI and Domain Model must be on the client. Because you Domain Model > contains a lot of information e.g. about validation the input, and I don't > want a Server Round Trip every time the users enters something in a

textbox.
> But I'm also thinking about putting the same domain objects on the server > aswell and use some kind of serialization using .NET Remoting or Web
> Services. Anyone else placing the Domain Model on both the Client and
> Server?
>
> Can you recommend any third party frameworks, which addresses any of these > problems? I find many of the MS Reference application to be to exotic.
>
> I know these are big questions for a thread in a newsgroup... but never

the
> less, I haven't found any books or articles that really deals with
> these
> issues.
>
> Best regards,
> Thomas
> MCSD, MCSE+I, MCP+SB
>
>



Jul 21 '05 #5
Buschmann: Pattern Oriented Software Architecture
http://www.amazon.com/exec/obidos/tg...glance&s=books

Microsoft Patterns and Practices: discussion of the Layers pattern (Not an
application block!)
http://msdn.microsoft.com/library/de...pplication.asp

GoF is never easy. But it is much more comprehensive than the DP Explained
book.

Now: for the follow-up:
If you view the interaction with the domain model as a series of messages,
then it's not too difficult to seperate the View from the Model.

In other words, you wouldn't need to warn the user that they cannot add
contact information on the unsaved user record, since the act of adding
contact information would necessarily trigger a request to send the user
record to the domain model. Either that, or you don't prevent the user from
adding contact info to an unsaved record. (Why NOT add contact info to an
unsaved user? The most common reason I hear is when folks are using
Identity columns as their primary keys in the Database... but that's easy to
work around... use GUIDs. Since the app can generate a unique id, there is
no need to create a transaction to write a record just to get the joining
data value back. Just create the Guid, use it as the primary key in one
message, and the foreign key in another. No problems and no need to
round-trip one transaction before generating another).

That goes back to my comment about creating a services interface between the
front end and the domain model. It really forces you to decouple your
system.

Good luck and I hope this helps,

--- Nick

"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:eT******** ******@TK2MSFTN GP11.phx.gbl...
Hello Nick

Thanks for you input.

First... Yes, you are right, I haven't read the GoF book yet. I thought I
start with something a bit lighter which Design Patterns Explained was (a
great introduction to OOD though). Is it readable for a .NET guy?

Buschmann... never heard of him (embarrassed smiley here). I took a look on Amazon... can you recommend a specific book?

I read a lot from the Microsoft Patterns & Practices group. I like the
Application Blocks, although I don't really see them as a design guide....
they are just... well Application Blocks.

Regarding my problem about separating the Business and the UI. I agree that business rules is much more than validation. But I often find that all kind of rules are need in the UI. E.g. which menu items is shown, warnings and
other things to make sure that exceptions doesn't occurs when calling the
Domain Model. This might sound odd, but e.g. I might have a rule that I
can't call Customer.AddCon tactInformation , if the customer is inactive or
unsaved. So I'd make a Property on the Customer called
AddContactInfor mationAllowed. I use this property to decide whether a
certain menu option is available, and/or I call this before
AddContactInfor mation, to make sure that it doesn't throw an exception.

For me this kind of interaction is a must to make a usable client
application (which is what's count in the end... at least for me), but I
don't se much of this kind in the OO books. But I will consider splitting up the Domain Model in two (on for validation like things, and one for hiding
business rules)... I'm just not quit sure that this is doable, if related
responsibilitie s is to be grouped on the same object.

Thomas

"Nick Malik" <ni*******@hotm ail.nospam.com> wrote in message
news:7MG0d.4177 94$%_6.111013@a ttbi_s01...
Yes... that's a lot for a newsgroup.

Start here:
http://www.microsoft.com/resources/p...s/default.mspx

I, too, have read many of the same books. You didn't mention the Design
Patterns book itself (Gang of Four: Gamma, Helm, Johnson, and Vlissides) but
it, too, is an excellent volume. There are also a number of patterns

books
that describe code in C# that have been coming out in the past two years.

The books do not focus on a particular tier. The Design Patterns books,
specifically, focus on a specific level of abstraction. The Fowler book
focuses on a different level of abstraction. Buschmann takes on the
architectural level. Honestly, to answer your questions, Buschmann is the best of the group.

The Microsoft site has some very specific advice for the .NET platform

with
regards to optimizations.. . worth looking into.

As for me: my middle tier is normally tailored to one thing: hiding the
business rules. That requires real analysis: what are the business

rules...
what will change... how will they change... how will we maintain them.

Config files are not good for business rule changes... they are too
tactical. You can change the name of a stored proc in the config file.

To
change the business rules, you need to encapsulate logic, not just
constants. Using pluggable components will only get you so far.

So, if the business layer has very few business rules, it's really thin.
For many purposes, especially for domain tables (lookup tables), I don't
have any logic at all in the middle tier. In that case, I often simply

pass
the data through directly from the DAL to the UI layer as an array of
DataRows. I'll even occasionally bind directly to a control (not often,

but
for drop-downs, it's good). On the other hand, if the business layer has business rules to encapsulate, then I will organize the objects so that
managing those rules makes sense. This is where we start to deviate from "business objects that mirror the database". This is where the design
patterns come in handy. You really have to map your data into objects

that
isolate change and minimize complexity.

I've yet to find a tool or framework that does more than simply
copy-and-reflect operations from the database through the middle tier. I don't use them. WHat a massive waste of time and processing power.

Heck...
the DataSet object does a better job than most of these, and it doesn't
require a huge amount of effort to use! (I don't use it either... I'm

just
making a point).

As for copying the validation rules: For a thick client app, I'd have the same validation dll on both the client and the server. That way, you can insure common rules. Note: business rules are much more than validation. I'd have basic validation types that I can use in both places, but the

rest
of the rules are quite different.

As for use of remoting: depends on the kind and style of scalability you
want to achieve. For my preference, remoting is too tightly coupled for

the
kinds of things that I do... I tend toward web services... but that may

not
be advice that you can use... depends on your app.

I hope this info is helpful.
--- Nick Malik
Application Architect
MCSD, CFPS, Certified Scrummaster
"Thomas Jespersen" <tj*@nospam.men tum.dk> wrote in message
news:ec******** ********@TK2MSF TNGP14.phx.gbl. ..
Hello

I've been reading a lot of great OOD/OOP books lately (e.g.. Martin

Fowlers
UML Distilled, Patterns of Enterprise Application Architecture,

Refactoring,
Kent Becks's Test Driven Development, and also a book called Design

Patterns
Explained.)... al of them with the focus on Java, because I think the best books are targeted Java. But the all fit very well to the .NET platform.
I have one big problem when reading these great books, and that is that they
focus almost entirely on the Domain Model (that is the Middle Layer in
a 3 layered architecture). They hardly mention that the code you write is
to
be
used in a UI interface and committed to a database ([PoEAA] might be
an exception). I find the separation of Business Login and UI to be the

hardest
thing. And also I find the performance issues when talking to the

Database to a very tricky thing, that calls for a few hack in the Domain Layer (I'm almost only doing thick clients... that is no web).

So I would like to know how you OO Guys really work (references to books or
articles would be great).

Don't you design your database the same way that you design you
Business Model if you are responsible for all 3 layers/tiers?

How much time does you spend on writing the DAL (the mapping between the
OO
and the Database)? Do you use any kind of O/R Mappers to help you
write the
DAL?

Where do you place the tiers in a Smart Client configuration? The way
I see
it the UI and Domain Model must be on the client. Because you Domain Model contains a lot of information e.g. about validation the input, and I don't want a Server Round Trip every time the users enters something in a

textbox.
But I'm also thinking about putting the same domain objects on the server aswell and use some kind of serialization using .NET Remoting or Web
Services. Anyone else placing the Domain Model on both the Client and
Server?

Can you recommend any third party frameworks, which addresses any of these problems? I find many of the MS Reference application to be to exotic.

I know these are big questions for a thread in a newsgroup... but

never the
less, I haven't found any books or articles that really deals with

these issues.

Best regards,
Thomas
MCSD, MCSE+I, MCP+SB



Jul 21 '05 #6

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

Similar topics

2
478
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT VOTE NOW; you may be able to vote on a version of this proposal later. See the PROCEDURE section below if you need information about how the discussion works. PLEASE POST ANY FOLLOWUPS TO THE NEWSGROUP NEWS.GROUPS.
8
2689
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT VOTE NOW; you may be able to vote on a version of this proposal later. See the PROCEDURE section below if you need information about how the discussion works. PLEASE POST ANY FOLLOWUPS TO THE NEWSGROUP NEWS.GROUPS.
0
1640
by: Cara | last post by:
LAST CALL FOR VOTES (of 2) unmoderated group comp.databases.etl Newsgroups line: comp.databases.etl Extraction, transformation, loading issues. Votes must be received by 23:59:59 UTC, 12 Dec 2003. This vote is being conducted by a neutral third party. Questions about the proposed group should be directed to the proponent.
1
3198
by: Hai-Chu Hsu | last post by:
Hi, I want to restore my databases from the old SQL Server installation into a new installation of SQL Server. My new installation of SQL Server has different data path from the old installation. In addition, the data owners of some databases in the old SQL Server installation are not dbo. I have backups for all the databases in the old installation SQL Server. Can anyone tell me how to restore my databases from the old SQL Server
0
2295
by: Cara Altman | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.etl This is a formal Request For Discussion (RFD) for the creation of a world-wide unmoderated Usenet newsgroup comp.databases.etl. This is not a Call for Votes (CFV); you cannot vote at this time. Procedural details are below.
3
7763
by: Amit | last post by:
Hi when I try to run LIST ACTIVE DATABASES AT DBPARTITIONNUM <partnum> or LIST ACTIVE DATABASES GLOBAL, I always get an error message. Does anyone know why? I'm on v8 fp 5 output : db2 => list active databases at dbpartitionnum 1; SQL0104N An unexpected token "1" was found following "<identifier>". Expected tokens may include: "GLOBAL". SQLSTATE=42601 db2 => list active databases at GLOBAL;
1
3347
by: com | last post by:
Extreme Web Reports 2005 - Soft30.com The wizard scans the specified MS Access database and records information such as report names, parameters and subqueries. ... www.soft30.com/download-1-11975.htm - 31k - Cached - Similar pages MDBSecure 1.0.8.0 - Soft30.com Utility which makes it easy to create secure MS Access Databases, ... MS Access 2000/2003 format. 30 day money back guarantee, 30 day trial. ...
6
2901
by: Andy | last post by:
Someone posted this official proposal to create comp.databases.postgresql.general again. He wrote his own charter. As far as I know, he did not consult any of the postgresql groups first. There may be an upcoming vote on this, so please stay informed and read news.newgroups.announce for updates. Also see message <2uu44nF2eodc0U1@uni-berlin.de> for an example of the proponent's temperament.
6
1695
by: Tjerk Wolterink | last post by:
Don't know wether this is the right newsgroup, anyways: Has anyone some experience with Native XML Databases. Im planning to use this: http://exist.sourceforge.net/ It has many advantages over Object Relational Mapping, (that is how i do it now).
3
2174
by: AK | last post by:
Hi Our product uses MS-SQL Server 2000. One of our customer has 10 installations with each installation stroring data in its own database. Now the customer wants to consolidate these databases into one and we already have plan for that by consolidating one DB at a time. But first they want to find how many unique or duplicate entries they have across all the 10 databases Assumptions:
0
9386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10144
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9937
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
8821
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
7366
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
6642
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
5270
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...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2793
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.