1 <!-- adapted from the inheritance example at: http://atlas.asp.net/quickstart/atlas/doc/javascript/default.aspx -->
4 <script type="text/javascript" src="../../ScriptLibrary/AtlasCore.js"></script>
5 <script type="text/javascript">
6 Type.registerNamespace("Demo");
8 Demo.Person = function(firstName, lastName, emailAddress) {
9 var _firstName = firstName;
10 var _lastName = lastName;
11 var _emailAddress = emailAddress;
13 this.getFirstName = function() {
17 this.getLastName = function() {
21 this.getName = function() {
22 return _firstName + " " + _lastName;
25 this.getEmailAddress = function() {
29 this.dispose = function() {
30 alert('bye ' + this.getName());
33 Type.registerClass('Demo.Person', null, Web.IDisposable);
35 Demo.Person.prototype.toString = function() {
36 return this.getName() + ' (' + this.getEmailAddress() + ')';
39 Demo.Employee = function(firstName, lastName, emailAddress, team, title) {
40 Demo.Employee.initializeBase(this, [firstName, lastName, emailAddress]);
45 this.getTeam = function() {
48 this.setTeam = function(team) {
51 this.getTitle = function() {
55 Type.registerClass('Demo.Employee', Demo.Person);
57 Demo.Employee.prototype.toString = function() {
58 return Demo.Employee.callBaseMethod(this, 'toString') + '\r\n' + this.getTitle() + '\r\n' + this.getTeam();
61 var Frank = new Demo.Person ("Frank", "Smith", "franksmith@yoyodyne.com");
62 alert (Frank.toString());
64 var Molly = new Demo.Employee ("Molly", "Hatchett", "molly@whoknew.com", "Marketing", "Vice President");
65 alert (Molly.toString());