attachViews

Summary

The method to override to isolate code for attaching views to models.

Usage

public abstract void attachViews()

Description

Override this method to provide isolated code for attaching views to models. This isolated method enables clean separation of test code. In your test code, avoid attaching views to make business logic easily testable.

Examples

Basic Usage
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import Altitude.Frontend;
 
external $;
 
class CustomersController : Controller
{
    Views.Customers view = new Views.Customers();
    Models.Customers model = new Models.Customers();
 
    public override void attachViews() {
        this.model.attach(this.view);
    }
}
 
CustomersController controller = new CustomersController();
controller.attachViews();

Share

HTML | BBCode | Direct Link