我有五个共享公用代码的控制器。让它们从父控制器继承还是使用问题最好?例如: class PostsController < ApplicationController
before_action :authenticate, :set_project
layout 'projects'
end
class CommentsController < ApplicationC
我组织了我的程序,将每个实体分割到它自己的文件中。 这是这样的。 main.c #include "student.h"
#include "subject.h"
#include "classroom.h"
#define PI 3.14
int sum(int a, int b);
student.h typedef struct st student;
student.c