Information Technology Reference
In-Depth Information
6.3.2 Entity, Boundary, and Control Objects
Entity objects are classes that encapsulate the business model, including rules,
data, relationships, and persistence behavior, for items that are used in your
business application. For example, entity objects can represent the logical structure
of the business, such as product lines, departments, sales, and regions. They could
also be used to represent business documents, such as invoices, change orders, and
service requests. In another scenario, entity objects could be used to depict
physical items, such as warehouses, employees, and equipment. From an object-
oriented perspective, an entity object represents an object in the real-world
problem domain. From a relational database perspective, an entity object provides
a Java representation of data from a database table. Advanced programmers can
map entity objects to other types of data sources, such as spreadsheets, flat files,
and XML files. Depending on how you want to work, you can automatically create
entity objects from existing database tables or define entity objects and use them to
automatically create database tables.
Business logic should be written into entity objects, because they consistently
enforce information for all viewing of any data, accessed via any type of client
interface. Business logic can include the following items:
• Business Rules and Policy: When adding or modifying data, you should ensure
that the data complies with your organizations' procedures before adding it to
the database. For example, you could increase the salary when an employee is
promoted, give an employee 3 weeks of vacation after they have been at a
company 3 years or change the status of an order to shipped after all items in an
order have been mailed to a customer.
• Validation Logic: When adding new data, you should ensure that the data is
valid before storing it in the database. For example, you could ensure that a job
code is an existing valid job code.
• Deletion Logic: You should make sure that data is deleted only when appro-
priate and that any dependencies are handled. For example, you could prevent
an on-leave employee from being wrongly removed.
• Calculations: You should efficiently perform data calculations in the business
logic tier. For example, you could calculate an employee's monthly pay based
on a given hourly rate.
• Default Value Logic: When creating new data, you should add appropriate
default values. For example, you could provide a default benefit plan based on
an employee's job code.
• Security: You should make sure that data is read and modified only by users
with the appropriate authority. For example, you could ensure that only the
direct manager of a given employee can change said employee's salary.
Boundary Objects represent the interactions between the user and the system.
These often represent input/output systems which the user utilizes (Schach 2008 ).
For example, if a user needs to extract information from the system, boundary
Search WWH ::




Custom Search