viper / app.py
hoduyquocbao's picture
update viper
6c9722e
raw
history blame
905 Bytes
import logging
from channels.channel import Channel
from entities.entity import Entity
from interactors.interactor import Interactor
from presenters.presenter import Presenter
from routers.router import Router
from views.view import View
def initialize_app():
# Tạo các thành phần
channel = Channel()
entity = Entity()
interactor = Interactor(channel, entity)
presenter = Presenter(channel)
router = Router(channel)
view = View(channel)
# Xử lý các sự kiện từ người dùng
presenter.handle('render')
presenter.handle('create', 'sampleKey', 'sampleValue')
presenter.handle('read', 'sampleKey')
presenter.handle('update', 'sampleKey', 'updatedValue')
presenter.handle('delete', 'sampleKey')
# Điều hướng
router.navigate('Home')
if __name__ == "__main__":
logging.basicConfig(level=logging.INFO)
initialize_app()