Naked objects is an architectural pattern used in software engineering. It is defined by three principles:
The naked object pattern's innovative feature arises by combining the 1st and 2nd principles into a 3rd principle:
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]
Pawson's thesis[1] claims four benefits for the pattern:
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]
The naked objects pattern has relevance to several other disciplines and/or trends, including:
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.
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 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]
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]
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.