PHP 에서도 anotation 드리븐을 구현 할 수 있을거 같내요 ㅎ;
잘만 활용 하면, spring framework 장점만 경량화 하여
php 진영에서도 ... framework 도 나오지 않을가 하는
생각을 문득 해봤습니다.
------------------------------------------------------------------
/** @Table("people") */
class Person {
// some code
}
class Person {
// some code
}
$reflection = new ReflectionAnnotatedClass('Person'); // by class name
$reflection->getAnnotation('Table')->value; // contains string "people"
$reflection->getAnnotation('Table')->value; // contains string "people"
----------------------------------------------------------------------
class RolesAllowed extends Annotation {}
/** @RolesAllowed({'admin', 'web-editor'}) */
class CMS {
// some code
}
$reflection = new ReflectionAnnotatedClass('CMS');
$annotation = $reflection->getAnnotation('RolesAllowed');
$annotation->value; // contains array('admin', 'web-editor'
/** @RolesAllowed({'admin', 'web-editor'}) */
class CMS {
// some code
}
$reflection = new ReflectionAnnotatedClass('CMS');
$annotation = $reflection->getAnnotation('RolesAllowed');
$annotation->value; // contains array('admin', 'web-editor'
-------------------------------------------------------------
/** @Mapping(inheritance = @SingleTableInheritance, columns = {@ColumnMapping('id'), @ColumnMapping('name')}) */
class Person {}
$reflection = new ReflectionAnnotatedClass('Person');
$annotation = $reflection->getAnnotation('Mapping');
$annotation->inheritance; // SingleTableInheritance annotation
$annotation->columns; // array of ColumnMapping annotations
$annotation->columns[0]->value; // 'id'
class Person {}
$reflection = new ReflectionAnnotatedClass('Person');
$annotation = $reflection->getAnnotation('Mapping');
$annotation->inheritance; // SingleTableInheritance annotation
$annotation->columns; // array of ColumnMapping annotations
$annotation->columns[0]->value; // 'id'
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 7930 | 9년 전 | 370 | ||
| 7929 | 9년 전 | 262 | ||
| 7928 | 9년 전 | 374 | ||
| 7927 | 9년 전 | 296 | ||
| 7926 | 9년 전 | 644 | ||
| 7925 | 9년 전 | 311 | ||
| 7924 | 9년 전 | 286 | ||
| 7923 | 9년 전 | 322 | ||
| 7922 | 9년 전 | 342 | ||
| 7921 | 9년 전 | 374 | ||
| 7920 | 9년 전 | 295 | ||
| 7919 | 9년 전 | 311 | ||
| 7918 | 9년 전 | 475 | ||
| 7917 | 9년 전 | 314 | ||
| 7916 | 9년 전 | 382 | ||
| 7915 | 9년 전 | 367 | ||
| 7914 | 9년 전 | 379 | ||
| 7913 | 9년 전 | 505 | ||
| 7912 | 9년 전 | 379 | ||
| 7911 | 9년 전 | 332 | ||
| 7910 | 9년 전 | 360 | ||
| 7909 | 9년 전 | 471 | ||
| 7908 | 9년 전 | 369 | ||
| 7907 | 9년 전 | 319 | ||
| 7906 | 9년 전 | 336 | ||
| 7905 | 9년 전 | 329 | ||
| 7904 | 9년 전 | 297 | ||
| 7903 | 9년 전 | 293 | ||
| 7902 | 9년 전 | 514 | ||
| 7901 |
|
9년 전 | 716 | |
| 7900 | 9년 전 | 538 | ||
| 7899 | 9년 전 | 346 | ||
| 7898 | 9년 전 | 339 | ||
| 7897 | 9년 전 | 296 | ||
| 7896 | 9년 전 | 316 | ||
| 7895 | 9년 전 | 424 | ||
| 7894 | 9년 전 | 347 | ||
| 7893 | 9년 전 | 279 | ||
| 7892 | 9년 전 | 323 | ||
| 7891 | 9년 전 | 710 | ||
| 7890 | 9년 전 | 1174 | ||
| 7889 | 9년 전 | 730 | ||
| 7888 |
limsy1987
|
9년 전 | 528 | |
| 7887 | 9년 전 | 499 | ||
| 7886 | 9년 전 | 389 | ||
| 7885 | 9년 전 | 361 | ||
| 7884 | 9년 전 | 370 | ||
| 7883 | 9년 전 | 350 | ||
| 7882 | 9년 전 | 362 | ||
| 7881 | 9년 전 | 392 | ||
| 7880 | 9년 전 | 519 | ||
| 7879 | 9년 전 | 412 | ||
| 7878 | 9년 전 | 1157 | ||
| 7877 | 9년 전 | 707 | ||
| 7876 | 9년 전 | 436 | ||
| 7875 | 9년 전 | 509 | ||
| 7874 |
|
9년 전 | 780 | |
| 7873 | 9년 전 | 482 | ||
| 7872 | 9년 전 | 616 | ||
| 7871 | 9년 전 | 446 | ||
| 7870 | 9년 전 | 569 | ||
| 7869 | 9년 전 | 387 | ||
| 7868 | 9년 전 | 384 | ||
| 7867 | 9년 전 | 381 | ||
| 7866 | 9년 전 | 441 | ||
| 7865 | 9년 전 | 397 | ||
| 7864 | 9년 전 | 463 | ||
| 7863 | 9년 전 | 454 | ||
| 7862 | 9년 전 | 431 | ||
| 7861 | 9년 전 | 588 | ||
| 7860 | 9년 전 | 594 | ||
| 7859 | 9년 전 | 363 | ||
| 7858 | 9년 전 | 672 | ||
| 7857 | 9년 전 | 1021 | ||
| 7856 | 9년 전 | 484 | ||
| 7855 | 9년 전 | 698 | ||
| 7854 | 9년 전 | 699 | ||
| 7853 | 9년 전 | 538 | ||
| 7852 | 9년 전 | 473 | ||
| 7851 | 9년 전 | 447 | ||
| 7850 | 9년 전 | 542 | ||
| 7849 | 9년 전 | 316 | ||
| 7848 | 9년 전 | 367 | ||
| 7847 | 9년 전 | 589 | ||
| 7846 | 9년 전 | 405 | ||
| 7845 | 9년 전 | 367 | ||
| 7844 | 9년 전 | 367 | ||
| 7843 | 9년 전 | 373 | ||
| 7842 | 9년 전 | 367 | ||
| 7841 | 9년 전 | 354 | ||
| 7840 | 9년 전 | 362 | ||
| 7839 | 9년 전 | 395 | ||
| 7838 | 9년 전 | 479 | ||
| 7837 | 9년 전 | 320 | ||
| 7836 | 9년 전 | 359 | ||
| 7835 | 9년 전 | 441 | ||
| 7834 |
|
9년 전 | 1169 | |
| 7833 | 9년 전 | 374 | ||
| 7832 | 9년 전 | 371 | ||
| 7831 | 9년 전 | 505 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기