473,396 Members | 1,734 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.

Persistence/Broker Layer questions

Hello,

I am laying out the architecture for a very large website that will
scale to a very large degree.

I have a couple of questions before I attempt to go and implement a
Broker/Persistence Layer.

1. With a broker layer, does this layer sit at the same level as the
Business Layer? So to speak, the presentation layer has knowledge of
both BL and PL? and then ONLY the PL has knowledge of the DataLayer?
Correct?

2. Should the Persistence layer be handled as a Singleton object?

3. Initially I am envisioning that I will have an encrypted cookie on
the client side that only holds the users unique id, then upon postback
the presentation layer gets the User business object from the
persistence layer and the persistence layer saves the object to Cache.
Is this correct?

Up to this point when creating apps, I was always a little
uncomfortable with mixing all the data persistence in the business
layer, thats why I think this approach is much more appealing.

Any other pointers before I embark?

Thanks for your help guys!!

Sean

Apr 14 '06 #1
2 2335
"dkode" <dk****@gmail.com> a écrit dans le message de news:
11**********************@u72g2000cwu.googlegroups. com...

| 1. With a broker layer, does this layer sit at the same level as the
| Business Layer? So to speak, the presentation layer has knowledge of
| both BL and PL? and then ONLY the PL has knowledge of the DataLayer?
| Correct?

Strictly, the PL should have no knowledge of the DataLayer, only of the BL.
The DataLayer should only know about the BL by using reflection to examine
any objects passed to it or to create objects to fulfil requests from the
BL.

| 2. Should the Persistence layer be handled as a Singleton object?

Usually.

| 3. Initially I am envisioning that I will have an encrypted cookie on
| the client side that only holds the users unique id, then upon postback
| the presentation layer gets the User business object from the
| persistence layer and the persistence layer saves the object to Cache.
| Is this correct?

I don't know about web apps, sorry.

| Up to this point when creating apps, I was always a little
| uncomfortable with mixing all the data persistence in the business
| layer, thats why I think this approach is much more appealing.

You are correct in avoiding mixing data with BOs, it simply isn't necessary.

Joanna

--
Joanna Carter [TeamB]
Consultant Software Engineer
Apr 14 '06 #2
dkode wrote:
Hello,

I am laying out the architecture for a very large website that will
scale to a very large degree.

I have a couple of questions before I attempt to go and implement a
Broker/Persistence Layer.
write your own? It's not a walk in the park :)

1. With a broker layer, does this layer sit at the same level as the
Business Layer? So to speak, the presentation layer has knowledge of
both BL and PL? and then ONLY the PL has knowledge of the DataLayer?
Correct?
It's often preferred in larger applications to not have the PL know
anything about the persistence logic. This leads to the advantage that
the team which works on the PL tier can't bypass BL tier functionality.
2. Should the Persistence layer be handled as a Singleton object?
depends. In a persistence layer where the meta-data is located in
data, it's preferred to have a singleton, to avoid having to reparse it
every time a call to the db has to be made. In a persistence layer
where the meta-data is located in code, you don't have to use a
singleton object.

This can have the advantage that the persistence layer is pure
stateless, which means that it doesn't cache tracking info of an
entity as well. This is preferable in webfarms/serverfarms where entity
E is loaded on server X but persisted on server Y and you of course
don't want Y to see E as a new entity.
3. Initially I am envisioning that I will have an encrypted cookie on
the client side that only holds the users unique id, then upon
postback the presentation layer gets the User business object from the
persistence layer and the persistence layer saves the object to Cache.
Is this correct?
The persistence layer retrieves the object because the BL tier tells
it to do that, which comes from the PL tier. the object itself is
transported back to the PL tier. What happens there with the object is
the business of the PL tier. So if it wants to cache it in the
webserver's cache, it can do that of course.
Up to this point when creating apps, I was always a little
uncomfortable with mixing all the data persistence in the business
layer, thats why I think this approach is much more appealing.


You can always mix it of course. It's often more convenient, though
also keep an eye on the separation of functionality accessable by the
various teams in your application. As it's a large application as you
said, it's often developed by subteams and my experience is that it's
often preferred that the GUI team isn't able to fetch/save data from
the DB, only through a tier that's setup for that, so that you can be
sure no shortcuts are made to avoid check logic / bl rules.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
Apr 15 '06 #3

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

Similar topics

6
by: Paolo Losi | last post by:
Hi all, I'm pretty new to the python language so please excuse me if this is FAQ... I'm very glad to be part of the list! :-) I'm looking into a way to implement a generic workflow framework...
49
by: Paul Rubin | last post by:
I've started a few threads before on object persistence in medium to high end server apps. This one is about low end apps, for example, a simple cgi on a personal web site that might get a dozen...
1
by: Joe | last post by:
I was wondering if there are any recommended persistence frameworks for use in .NET that could be recommended. I am looking for the following requirements: Free/Open Source or very inexpensive....
2
by: Matheus Eduardo | last post by:
Hi everyone, I'm looking for an persistence layer for C# and .NET Framework, like Sun JDO or Castor JDO for Java. Does anyone could help me? Greetings in advance. Matheus Eduardo
2
by: Ralph Lund | last post by:
Hi NG. I am intersted in which persistence mechanism you are using in your projects (which persitence layer - data access classes, or-mapping-tool) (for databases) Which experiences do you...
3
by: Larry Charlton | last post by:
I'm building an n-Layer application that may be segmented into n-Tiers. For the user interface I'm implementing an MVC architecture. Since I can't access the page class directly from another...
13
by: Peter Morris [Droopy eyes software] | last post by:
Hi all Any recommendations for a good object persistence framework? I'd be interested in hearing from anyone with personal experience. Thanks Pete
4
by: Karch | last post by:
Lets say I have a number of web servers that all feed data to a common SQL Server database, which processes and sends to a master SQL Server. I am looking at a solution that involves Service Broker...
0
myusernotyours
by: myusernotyours | last post by:
Hi all, Am trying to create a Java Desktop App that uses Java Persistence in Netbeans. The database is MS Access but I tried with Mysql and got the same error. When I run the app( Create the...
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
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
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...
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.