728x90
반응형

작성일자 : 2019.09.07

 

1. 괄호 위치

 

GNU

if( )

   {

       doSomething..

   }

 

K&R

if( ){

    doSomething..

}

 

BSD

if( )

{

   doSomething..

}

 

 

2. 변수, 함수 명칭

 

카멜 표기법

ex) codingStyle

 

파스칼 표기법

ex) CodingStyle

 

스네이크 표기법

ex) coding_style

 

케밥 표기법

ex) coding-style

728x90
반응형

'용어 정리' 카테고리의 다른 글

함수 표현식 / 함수 선언식  (0) 2021.03.05
ECMAScript / JavaScript  (0) 2021.02.11
J2SE/J2ME/J2EE  (0) 2018.04.22
CPU/Core/Processor  (0) 2018.04.07
업데이트, 패치, 업그레이드  (0) 2018.02.09
728x90
반응형

[spring boot] AOP 설정

 

작성일자 : 2019.07.21

환경 : Spring Boot 2.1.6, Gradle 3

 

 

추가 및 수정 파일

 

0. 기본 개념

 

1) 관점(Aspect)

구현하고자 하는 횡단 관심사의 기능, 한개 이상의 포인트컷과 어드바이스의 조합으로 만들어진다.

 

2) 조인포인트(Join point)

관점(Aspect)를 삽입하여 어드바이스가 적용될 수 있는 위치

 

3) 어드바이스(Advice)

관점(Aspect)의 구현체로 조인 포인트에 삽입되어 동작하는 코드 



 

1. AOP 의존성 추가

 

build.gradle

..

dependencies {

   ..

   compile('org.springframework.boot:spring-boot-starter-aop')

   ..

}

 

 

 

 

2. AOP 사용 설정

 

ProjectApplication.java

 

package com.example.demo;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

@SpringBootApplication
@EnableAspectJAutoProxy // Enable AOP
public class AoptestApplication {
   public static void main(String[] args) {
      SpringApplication.run(AoptestApplication.class, args);
   }

}

 

 

 

3. AOP를 적용할 대상 구현

 

AopController.java

 

package com.example.demo;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.web.bind.annotation.*;

@RestController
public class AopController {
    private static final Logger logger = LoggerFactory.getLogger(AopController.class);

    @GetMapping("/hello")
    public void hello(){
        logger.info("hello AOP");
    }

}

 

 

 

4. AOP 설정 파일 추가

 

AopConfig.java

 

package com.example.demo;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class AopConfig{
    private static final Logger logger = LoggerFactory.getLogger(AopConfig.class);

    @Before("execution(* com.example.demo.AopController.*(..))")
    public void doSomethingBefore() {
        logger.info("AOP Test : Before ");
    }

    @After("execution(* com.example.demo.AopController.*(..)) ")
    public void doSomethingAfter() {
        logger.info("AOP Test : After");
    }
}

 

적용 대상의 실행 전,후에 각각 aspect 동작하도록 설정

 

 

# Advice 종류

 

@Before : 조인포인트 전에 실행 
@AfterReturning : 조인포인트에서 성공적으로 리턴 된 후 실행
@AfterThrowing : 예외가 발생하였을 경우 실행
@After : 조인포인트에서 메서드의 실행결과에 상관없이 무조건 실행
@Around : 조인포인트의 전 과정(전, 후)에 수행

 

 

# execution 포인트컷 예

 

execution([수식어] [리턴타입] [클래스이름] [이름]([파라미터])

 

 

 

5. 확인

 

대상 접근

로그 확인

 

 

728x90
반응형

'Java' 카테고리의 다른 글

[Spring] Cache 적용  (0) 2019.09.28
Spring Boot + MySQL 연동  (0) 2019.09.14
[Spring Boot-Vue] 프로젝트 빌드  (0) 2019.07.21
[Spring Boot] JPA(Hibernate) 적용  (0) 2019.07.06
[Spring Boot] Eclipse 내 Lombok 설치  (0) 2019.07.05
728x90
반응형

[vue] vuetify 사용 설정

 

작성일자 : 2019.07.21

환경 : Vue 2.6.10, Vue-Cli 2.9.10, npm 6.9.0, webpack 3.12.0

 

 

1. vuetify 추가

 

%ProjectPath%> npm install vuetify

 

node_modules 밑에 vuetify 생성 확인

 

 

 

2. vuetify 사용 설정

 

%ProjectPath%> vue add vuetify

 

아래 설정이 자동으로 추가됨

 

main.js

...
import vuetify from './plugins/vuetify'
new Vue({
  render: h => h(App),
  vuetify,
  router
}).$mount('#app')

...

 

src/plugins/vuetify.js

import Vue from 'vue';
import Vuetify from 'vuetify/lib/framework';

Vue.use(Vuetify);

export default new Vuetify({
});

 

src/components/HelloWorld.vue

<template> 
   ...
   ...
</template>

<script>
   export default {
      ...
      ...
   }
</script>

 

app.vue template 수정

 

 

3. 확인

 

vuetify 버튼 적용 확인

 

 

<template>
  <v-app id="app">
    <v-btn color="success">Success</v-btn
    <v-btn color="error">Error</v-btn>
    <v-btn color="warning">Warning</v-btn>
    <v-btn color="info">Info</v-btn>
  </v-app>
</template>

 

접근 시 vuetify 버튼 확인 가능

 

4. 사용 예시

 

vuetify 홈페이지에서 추가하고 싶은 Component를 찾기

https://vuetifyjs.com/ko/components/api-explorer

 

'Footer를 만들어보자'

 

예제 우측 상단 <> 버튼을 누르면 template과 script 코드가 나온다

 

 

foorter.vue 생성 후 template, script 복붙

 

 

 

컴포넌트를 사용할 vue에 추가

 

...
<script>
import vfooter from '@/components/footer'
export default {
   name: 'App',
   components: {
      vfooter
   }
}
</script>
...

 

template에 추가 

# vuetify 컴포넌트는 <v-app> 태그 안에 존재해야함

 

 

footer 추가 확인

728x90
반응형

'도구, 툴 > 세팅' 카테고리의 다른 글

[React] 기본 프로젝트 띄우기  (0) 2019.11.03
SVN 저장소 설정  (0) 2018.07.21
GIT 저장소 설정  (0) 2018.07.15
node.js 설치  (0) 2018.06.10
VSCode 설치  (0) 2018.06.10

+ Recent posts