首页 \ 问答 \ 关系数据库设计模式?(Relational Database Design Patterns?)

关系数据库设计模式?(Relational Database Design Patterns?)

设计模式通常与面向对象的设计有关。
是否有用于创建和编程关系数据库的 设计模式 ?
许多问题当然必须有可重用的解决方案。

示例将包括表设计,存储过程,触发器等的模式

是否有类似于martinfowler.com的在线存储库?


模式可以解决的问题的例子:

  • 存储分层数据(例如,具有1:1关键字和差异的类型的多个表的单个表...)
  • 以可变结构存储数据(例如,通用列与xml对分隔列...)
  • 非正规化数据(如何以最小的影响等等)

Design patterns are usually related to object oriented design.
Are there design patterns for creating and programming relational databases?
Many problems surely must have reusable solutions.

Examples would include patterns for table design, stored procedures, triggers, etc...

Is there an online repository of such patterns, similar to martinfowler.com?


Examples of problems that patterns could solve:

  • Storing hierarchical data (e.g. single table with type vs multiple tables with 1:1 key and differences...)
  • Storing data with variable structure (e.g. generic columns vs xml vs delimited column...)
  • Denormalize data (how to do it with minimal impact, etc...)

原文:https://stackoverflow.com/questions/145689
更新时间:2022-10-05 20:10

最满意答案

我猜你做得像:

{{App.SelectedBlock.id}}

您不应该在Handlebars模板中调用全局变量。 这是一种不好的做法。 但你可以这样做:

// in your template controller
selectedBlock: function(){
  return Ember.get('App.SelectedBlock');
}.property('App.SelectedBlock')

在hbs模板中:

{{selectedBlock.id}}

I guess you're doing smthing like:

{{App.SelectedBlock.id}}

You should not call global variables inside Handlebars template. This is a bad practice. But you can do smthing like this:

// in your template controller
selectedBlock: function(){
  return Ember.get('App.SelectedBlock');
}.property('App.SelectedBlock')

In hbs template:

{{selectedBlock.id}}

相关问答

更多
  • 我猜你做得像: {{App.SelectedBlock.id}} 您不应该在Handlebars模板中调用全局变量。 这是一种不好的做法。 但你可以这样做: // in your template controller selectedBlock: function(){ return Ember.get('App.SelectedBlock'); }.property('App.SelectedBlock') 在hbs模板中: {{selectedBlock.id}} I guess you'r ...
  • 我想问题在于你试图监听从未捕获的datetimepicker发起的事件,因此没有设置模型值。 为了使事情更加稳固,您应该在doneEditing函数中获取datetimepicker当前日期值,就在将模型保存回商店之前。 让我在代码中显示我的意思: window.App.EventController = Ember.ObjectController.extend( ... doneEditing: -> // relevant code line @get("model").se ...
  • 想通了。 Ember.run.bind实际上并不需要解绑定方法,您可以解除绑定jQuery事件。 代码示例: export default Ember.Component.extend({ _resizeListener: null, didInsertElement: function(){ // keep a reference to the event listener this._resizeListener = Ember.run.bind(this, this.pref ...
  • 您可以使用needs属性告诉ember您需要访问另一个控制器,然后您可以创建别名属性(实质上是创建对另一个属性的引用)。 App.LoginController = Ember.Controller.extend({ needs: ['application'], userId: Ember.computed.alias('controllers.applications.userId') }); 然后从登录控制器,您可以执行this.set('userId', 'fred'); You ...
  • 看起来这是在@ cyclomarc的回答后不久更新的(检查PR https://github.com/emberjs/data/pull/1145 )。 在烬数据'网址'现在是'主机'。 '命名空间'剧照仍然有效。 DS.RESTAdapter.reopen({ host: 'http://google.com', namespace: 'api' }); 向http://google.com/api/*发送请求 Ember v1.0.0-7 Ember Data v1.0.0-beta.1-17 ...
  • Ember数据切换到modelNameFromPayloadKey , typeForRoot不再在代码中使用,除非您专门调用它。 http://emberjs.com/api/data/classes/DS.RESTSerializer.html#method_typeForRoot Ember Data switched to modelNameFromPayloadKey, typeForRoot is no longer used in the code unless you are specifi ...
  • 我找到了自己的解决方案。 我需要使用一个ControllerAdvice注释和一个ModelAttribute注释,如下所示: @ControllerAdvice public class LayoutMenu { @ModelAttribute("foo") public String initMenu() { return "Hello Bar"; } } 这解决了我的问题。 I found my own solution. I need to use a Co ...
  • 对于POST请求,请使用json.loads(self.request.body)。 post()的参数是从url regex中提取的。 For a POST request, use json.loads(self.request.body). Arguments to post() are extracted from the url regex.
  • 如果您将数据存储在ember对象中并遵循ember get / set范例,那么您数据的所有更改都将反映到您的模板中。 例如, http://emberjs.jsbin.com/OMItuCiN/1 HBS