| --- |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| layout: docpage |
| title: Object oriented programming |
| description: Use Object-oriented programming in Royale |
| permalink: /features/oop |
| --- |
| |
| # Object oriented programming (OOP) |
| |
| Object-oriented programming, according to Richard Baldwin, is "a programming style that mimics the way most people think and work." In his book _Object Oriented Programming for ActionScript 3_ he gives a real-world example of putting together a child's playset. The kit for the playset has hundreds of little parts like nuts, bolts, and brackets. You assemble them into larger units: the swings, the playhouse, the slide, the framework. Those are the "objects" that you then combine to make the functioning playset. |
| |
| You can put together and test the slide without worrying about the swings. You can assemble the framework before you have anything to attach to it. If you have to make adjustments to the playhouse part, like replacing a cracked plastic shutter with a nice wooden one, that doesn't affect any other component of the playset. If you decide to move the swings from the left to the right of the framework, all the little bits that make up the swing component move with you; you don't have to deconstruct it here and build it all over again over there. |
| |
| ## Example |
| |
| |
| ## Further information |
| |
| _information and examples coming soon_ |