inference / app.py
hoduyquocbao's picture
viper
5b69d8a
raw
history blame contribute delete
875 Bytes
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 components.view import View
from type import TYPES
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__":
initialize_app()