FACTOID # 152: Thimpu Bhutan is the only world capital without traffic lights.
 
 Home   Encyclopedia   Statistics   Countries A-Z   Flags   Maps   Education   Forum   FAQ   About 
 
WHAT'S NEW
RECENT ARTICLES
More Recent Articles »
 

Encyclopedia > Cross cutting

Contents


Cross Cutting

Even though most classes in an object-oriented programming model will perform a single, specific function, they often share common, secondary requirements with other classes. These secondary requirements are said to cross-cut into the primary requirements. In object-oriented programming, a class consists of encapsulated instance variables and subprograms, the methods mentioned below. ... In computer science, object-oriented programming, OOP for short, is a computer programming paradigm. ... In object-oriented programming, a class consists of encapsulated instance variables and subprograms, the methods mentioned below. ...


For example, a typical application comprises cross cutting concerns like logging within the data access layer and also in the user interface layer whenever a thread enters or exits a method. Even though the primary functionality of each class is very different, the code needed to perform the secondary functionality, in this case logging is often identical. Data Access typically refers to software and activities related to storing, retrieving, or acting on data housed in a database or other repository. ... The user interface is the part of a system exposed to users. ... Many programming languages, operating systems, and other software development environments support what are called threads of execution. ... Used mainly in object-oriented programming, the term method refers to a piece of code that is exclusively associated either with a class (called class methods or static methods) or with an object (called instance methods). ... In object-oriented programming, a class consists of encapsulated instance variables and subprograms, the methods mentioned below. ...


Example Code

 public class SomeBusinessClass extends OtherBusinessClass { // Core data members // Other data members: Log stream, data-consistency flag // Override methods in the base class public void performSomeOperation(SomeOperationInformation info) { // Ensure authentication // Ensure info satisfies contracts // Lock the object to ensure data-consistency in case other // threads access it // Ensure the cache is up to date // Log the start of operation // ==== Perform the core operation ==== // // // // ==== End performing the core operation ==== // Log the completion of operation // Unlock the object } // More operations similar to above public void save(PersitanceStorage ps) { } public void load(PersitanceStorage ps) { } } 


In the code above, we must consider at least three issues:

  1. Other data members do not belong to this class's core concern.
  2. Implementation of performSomeOperation() seems to do more than perform the core operation; it seems to handle the peripheral data logging, authentication, multithread safety, contract validation, and cache management concerns. In addition, many of these peripheral concerns would likewise apply to other classes.
  3. It is not clear if save() and load() performing persistence management should form the core part of the class.

Data logging is the practice of recording, in some medium, sequential input, often in a time-associated format. ... In computer security, authentication (Greek: αυθεντικός, from authentes=author) is the process by which a computer, computer program, or another user attempts to confirm that the computer, computer program, or user from whom the second party has received some communication is, or is not, the claimed first party. ... Many programming languages, operating systems, and other software development environments support what are called threads of execution. ... The word validation has several related meanings: In general, validation is the process of checking if something satisfies a certain criterion. ... In computer science, a cache (pronounced kăsh) is a collection of data duplicating original values stored elsewhere or computed earlier, where the original data are expensive (usually in terms of access time) to fetch or compute relative to reading the cache. ... Persistence is the term used in computer science to describe a capability used by a computer programmer to store data structures in non-volatile storage such as a file system or a relational database. ...

See also

In computer science, an aspect is a part of a program that cross-cuts its core concerns, therefore violating its separation of concerns. ... In aspect-oriented computer programming, a pointcut is a set of join points. ...

Links


 

COMMENTARY     


Share your thoughts, questions and commentary here
Your name
Your location
Your comments
Please enter the 5-letter protection code


Lesson Plans | Student Area | Student FAQ | Reviews | Press Releases |  Feeds | Contact
The Wikipedia article included on this page is licensed under the GFDL.
Images may be subject to relevant owners' copyright.
All other elements are (c) copyright NationMaster.com 2003-5. All Rights Reserved.
Usage implies agreement with terms.