Naked objects

Last updated

Naked objects is an architectural pattern used in software engineering. It is defined by three principles:

Contents

  1. All business logic should be encapsulated onto the domain objects. This principle is not unique to naked objects; it is a strong commitment to encapsulation.
  2. The user interface should be a direct representation of the domain objects, with all user actions consisting of creating, retrieving, or invoking methods on domain objects. This principle is not unique to naked objects: it is an interpretation of an object-oriented user interface.

The naked object pattern's innovative feature arises by combining the 1st and 2nd principles into a 3rd principle:

  1. The user interface shall be entirely automatically created from the definitions of the domain objects. This may be done using reflection or source code generation.

The naked objects pattern was first described formally in Richard Pawson's PhD thesis [1] which includes investigation of antecedents and inspirations for the pattern including, for example, the Morphic user interface.

The first complete open source framework to have implemented the pattern was named Naked Objects. [2] In 2021, Pawson announced that he had subsequently applied the same pattern to the Functional Programming programming paradigm, as an alternative to the object-oriented programming paradigm, creating a variant of the Naked Objects framework called Naked Functions. [3]

Benefits

Pawson's thesis [1] claims four benefits for the pattern:

  1. A faster development cycle, because there are fewer layers to develop. In a more conventional design, the developer must define and implement three or more separate layers: the domain object layer, the presentation layer, and the task or process scripts that connect the two. (If the naked objects pattern is combined with object-relational mapping or an object database, then it is possible to create all layers of the system from the domain object definitions alone; however, this does not form part of the naked objects pattern per se.) The thesis includes a case study comparing two different implementations of the same application: one based on a conventional '4-layer' implementation; the other using naked objects.
  2. Greater agility, referring to the ease with which an application may be altered to accommodate future changes in business requirements. In part this arises from the reduction in the number of developed layers that must be kept in synchronisation. However the claim is also made that the enforced 1:1 correspondence between the user presentation and the domain model, forces higher-quality object modelling, which in turn improves the agility.
  3. A more empowering style of user interface. This benefit is really attributable to the resulting object-oriented user interface (OOUI), rather than to naked objects per se, although the argument is made that naked objects makes it much easier to conceive and to implement an OOUI.
  4. Easier requirements analysis. The argument here is that with the naked objects pattern, the domain objects form a common language between users and developers and that this common language facilitates the process of discussing requirements - because there are no other representations to discuss. Combined with the faster development cycle, it becomes possible to prototype functional applications in real time.

Use

The Department of Social Protection (DSP) (formerly known as the Department for Social and Family Affairs) in Ireland has built a suite of enterprise applications using the naked objects pattern. As part of its Service Delivery Modernisation (SDM) programme, the DSP designed a new enterprise architecture both to meet its planned new business requirements and to provide greater agility over the longer term. The naked objects pattern forms a key element of the SDM architecture. [4] In November 2002, the DSP went live with a new application to replace its existing system for the administration of child benefit. This is believed to be the first operational application of the naked objects pattern, anywhere. The DSP's experience in building this first application, including the reactions of users to the radical user interface is documented extensively in Pawson's thesis, [1] and more recently in a presentation at QCon London 2011. [5]

One of the more striking aspects of the DSP experience was the way that the Naked Objects technique permitted re-use very actively. Once a domain object, such as a Customer, had been defined for one 'application' it could be (has been) readily adapted with the minimum of tweaking and addition for use elsewhere. This suggests that the approach could become a favourite in government circles, where re-use is seen as a powerful technique for breaking down siloed systems. The UK 'Transformational Government' policy is particularly keen to see re-use become a standard requirement of new government systems, both consuming other governmental system components and making new ones available for others to use. This re-use is often seen in terms of services, but objects could be an equally powerful approach.

The DSP's initial 'Naked Object Architecture' was developed by an external contractor, [6] but the architecture was subsequently redeveloped around the Naked Objects Framework which now forms the basis for future application development, as confirmed in the request for tenders for a four-year programme of further applications to be built using naked objects. [7]

Relationship to other ideas

The naked objects pattern has relevance to several other disciplines and/or trends, including:

Object storage mechanisms

Object-relational mapping, object databases, and object persistence are all concerned with eliminating the need to write a conventional Data access layer underneath the domain objects. These patterns are complementary and potentially synergistic with the naked objects pattern, which is concerned with eliminating the need to write layers above the domain objects.

Agile software development

Naked objects is compatible with the trend towards agile development methodologies in many different ways, but especially to fine-grained iterative development. The DSP experience (described above) was probably also the largest application of agile software development techniques within a public-sector organization, worldwide. [8]

Domain-driven design

Domain-driven design is the idea that an evolving domain (object) model should be used as a mechanism to help explore requirements rather than vice versa. The fact that a naked object system forces direct correspondence between the user interface and the domain model makes it easier to attempt domain-driven design, and makes the benefits more visible. [9]

Model-driven architecture (MDA)

Although naked objects does not conform to the strict definition of MDA, it shares many of the same goals. Dan Haywood has argued that naked objects is a more effective approach to achieving those goals. [10]

Restful Objects

A standard for creating a RESTful interface from a domain object model. Though the Restful Objects specification does not state that the interface must be generated reflective from the domain model, that possibility exists.

See also

Related Research Articles

<span class="mw-page-title-main">Martin Fowler (software engineer)</span> American software developer, author and international public speaker on software development

Martin Fowler is a British software developer, author and international public speaker on software development, specialising in object-oriented analysis and design, UML, patterns, and agile software development methodologies, including extreme programming.

<span class="mw-page-title-main">Model–view–controller</span> Software design pattern

Model–view–controller (MVC) is a software design pattern commonly used for developing user interfaces that divides the related program logic into three interconnected elements. This is done to separate internal representations of information from the ways information is presented to and accepted from the user.

Model Driven Architecture (MDA) is a software design approach for the development of software systems. It provides a set of guidelines for the structuring of specifications, which are expressed as models. Model Driven Architecture is a kind of domain engineering, and supports model-driven engineering of software systems. It was launched by the Object Management Group (OMG) in 2001.

In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions.

Representational state transfer (REST) is a software architectural style that describes the architecture of the Web. It was derived from the following constraints:

In software testing, test automation is the use of software separate from the software being tested to control the execution of tests and the comparison of actual outcomes with predicted outcomes. Test automation can automate some repetitive but necessary tasks in a formalized testing process already in place, or perform additional testing that would be difficult to do manually. Test automation is critical for continuous delivery and continuous testing.

A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and deploy web applications on the World Wide Web. Web frameworks aim to automate the overhead associated with common activities performed in web development. For example, many web frameworks provide libraries for database access, templating frameworks, and session management, and they often promote code reuse. Although they often target development of dynamic web sites, they are also applicable to static websites.

Object-oriented analysis and design (OOAD) is a technical approach for analyzing and designing an application, system, or business by applying object-oriented programming, as well as using visual modeling throughout the software development process to guide stakeholder communication and product quality.

This is an alphabetical list of articles pertaining specifically to software engineering.

Model-driven engineering (MDE) is a software development methodology that focuses on creating and exploiting domain models, which are conceptual models of all the topics related to a specific problem. Hence, it highlights and aims at abstract representations of the knowledge and activities that govern a particular application domain, rather than the computing concepts.

Executable UML is both a software development method and a highly abstract software language. It was described for the first time in 2002 in the book "Executable UML: A Foundation for Model-Driven Architecture". The language "combines a subset of the UML graphical notation with executable semantics and timing rules." The Executable UML method is the successor to the Shlaer–Mellor method.

In computing, an object-oriented user interface (OOUI) is a type of user interface based on an object-oriented programming metaphor, and describes most modern operating systems such as MacOS and Windows. In an OOUI, the user interacts explicitly with objects that represent entities in the domain that the application is concerned with. Many vector drawing applications, for example, have an OOUI – the objects being lines, circles and canvases. The user may explicitly select an object, alter its properties, or invoke other actions upon it. If a business application has any OOUI, the user may be selecting and/or invoking actions on objects representing entities in the business domain such as customers, products or orders.

Domain-driven design (DDD) is a major software design approach, focusing on modeling software to match a domain according to input from that domain's experts.

<span class="mw-page-title-main">View model</span>

A view model or viewpoints framework in systems engineering, software engineering, and enterprise engineering is a framework which defines a coherent set of views to be used in the construction of a system architecture, software architecture, or enterprise architecture. A view is a representation of the whole system from the perspective of a related set of concerns.

Model–view–viewmodel (MVVM) is an architectural pattern in computer software that facilitates the separation of the development of the graphical user interface —be it via a markup language or GUI code—from the development of the business logic or back-end logic such that the view is not dependent upon any specific model platform.

Naked Objects for .NET or Naked Objects MVC is a software framework that builds upon the ASP.NET MVC framework.

Restful Objects is a standard covering RESTful interfaces to domain object models. The specification is published under a Creative Commons license.

Agile Automation refers to the application of select Agile software development principles, patterns and practices, to the area of industrial automation and process control software development. The term was coined by HAL Software (Ireland) in 2013.

<span class="mw-page-title-main">Enterprise Architect (software)</span> Visual modeling and design tool

Sparx Systems Enterprise Architect is a visual modeling and design tool based on the OMG UML. The platform supports: the design and construction of software systems; modeling business processes; and modeling industry based domains. It is used by businesses and organizations to not only model the architecture of their systems, but to process the implementation of these models across the full application development life-cycle.

References

  1. 1 2 3 Pawson, Richard (June 2004). Naked objects (PDF) (Ph.D. thesis). Trinity College Dublin.
  2. Naked Objects Framework
  3. From Naked Objects to Naked Functions
  4. Department of Social and Family Affairs - Guide to the Functions & Records of the Department, DSFA website - Freedom Of Information Archived 2012-10-19 at the Wayback Machine
  5. Case Study: Large-scale Pure OO at the Irish Government QCon London 2011
  6. Fujitsu, Case Study: The Department of Social and Family Affairs Fujitsu website Archived 2007-11-29 at the Wayback Machine
  7. Department of Social & Family Affairs, The ongoing development of the Department's Service Delivery Modernisation programme, 2007, e-tenders website
  8. Pawson, Richard; Wade, Vincent (2003). "Agile Development Using Naked Objects". Extreme Programming and Agile Processes in Software Engineering. XP'03. LNCS. Vol. 2675. pp. 97–103. doi:10.1007/3-540-44870-5_13. ISSN   0302-9743.
  9. Haywood, D., Domain-Driven Design using Naked Objects, 2009, Pragmatic Programmers
  10. Haywood, D (2004) MDA: Nice idea, shame about the...