全都是问企业级架构的, 刚写了一点关于企业级架构的心得, 抛砖引玉吧
There are different kinds of applications in a enterprise system. Some of apps
produce long time heavy database access, some of apps produce lots of light
database access.
We could build an Queued engine that could handle long time tasks such as data
loading or reporting, every task has a single database connection, and their
execution process could to be well controlled by engine's traffic control feature.
For other kinds of applications such as web and GUI tools in the system, In
addition, it is not practical to move all GUI tools to web considering web page
can hardly provide rich GUI controls to meet the user's requirements. These
applications can produce a lot of light database access, and we could not control
how many these kinds of database access would happen simultaneously, it is
impossible to assign every web client or GUI tool a database connection, since
that might cost a lot of database resource.
A solution here is database connection pooling. Most of app server provide a
database connection pool, We could make the applications access the database
via the app server, so there will be no idle user database connection existing.
Another problem for us is how to put business logic code together, and allow
web clients and GUI tools to share this business logic code without copying
and pasting. A solution is: Since we already have a J2ee app server, we could
put the business logic onto the app server. App server provides ado
main objects
container to manage business objects, the object oriented model is closer to
the real world, and is much easier to implement business logic, and favorable
for designing and modeling the system. One can understand the system by looking
at the object model instead of going through lots of functions or APIs.
The app server hasdo
ne a lot work to manage the memory and threads.
eg, it uses context switching technology to put the idle objects into disk and
bring it back once you need for ignoring the memory overhead. It allows programmer
to write code more easily to access thread-safe objects and non thread-safe
objects in different ways. It provides a public repository to store session
information for long transaction stateless task, we can implement a persistence
data access layer to make most of light database access SQL get generated
automatically instead of manually writing a lot of SQL, and the heavy database
access can be handled by writing well-tuned SQL and putting them on the Queued
engine for traffic control
We could develop anddo
cument a set of public interface functions based on web
service and c# connector for servicing GUI tools and web, web service is for
external clients who have lower speed connection and are located on the outside
of a firewall, c# connector is for internal users who are on the inside of a
firewall and local network, we could develop a plug-in based client GUI framework,
and make it upgrading automatically. GUI tools and web page only handle the
UI interaction and syntactic validation. All business logic has to be executed
by invoking the public interface function.