dsq30861 2011-05-20 11:54
浏览 32
已采纳

默认设置/环境类的术语/命名

I'm working on yet another framework for PHP, and have run into a small dilemma. I'm currently working with the core modules, which all are supposed to work stand-alone but I'd like to have a class that creates a default setup or environment that can be used directly or extended by your app. So I need to find a good term/name for this class.

Current candidates:

  • Engine
  • Environment
  • Main
  • Base
  • Init / Initializer
  • Bootstrap
  • App / Application (Chosen!)

The class resides in the Core-namespace, i.e. Framework/Core/ClassName.

Since I can't decide on which one to use I'm hoping you guys can help me pick the right one by shedding some more light on the terminologies of frameworks. I welcome new additions to the list above.

Just to make this as clear as possible, here's an example of how it's intended to be used:

use Framework/Core/ClassName as App;

// Create instance
$app = new App;
$app->run();

// Static initialization
App::run();

The above will setup a default environment with the most commonly used features of a modern framework. It will load config and url files from default locations and also setup default dispatch routes.

  • 写回答

2条回答 默认 最新

  • doucandiao9180 2011-05-20 12:36
    关注

    i usually try to use separate my Application and Config objects. Like

    class MyApp extends App
         task specific methods
    
    class MyConfig extends Config
         task specific settings
    
    $app = new MyApp(new MyConfig);
    $app->run();
    

    The former can be called App(lication), Engine, Dispatcher, etc - something that emphasises it "actor" nature, the latter can be Environment, Config, Settings, Options etc.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了