Giter Site home page Giter Site logo

Controllers architecture about appfairy HOT 2 CLOSED

dab0mb avatar dab0mb commented on May 24, 2024
Controllers architecture

from appfairy.

Comments (2)

DAB0mB avatar DAB0mB commented on May 24, 2024

Hey @cray0000. I'm glad to see that people are enjoying my work :-) and thanks for the feedback. I've actually noticed these issues initially, but wasn't sure how I should go with the solution; but it was important for me to release a version asap.

Regards issue 1 - Your solution is pretty nice because it makes things much clearer. I would like to suggest another thing - import the view in the controller module and define the controller explicitly, like so:

import React from 'react'
import MyView from '../views/MyView'

class MyController extends React.Component {
  render() {
    return (
      <MyView />
    )
  }
}

// Notice how we match the view to the controller
export default MyView.Controller = MyController

What do you think of that? It's less strict than the first solution and much more flexible but can potentially cause a poor architecture by the user.

For issue 2 - I don't think that using the socket of an af-el should be mandatory. Sometimes we would like to hide some elements based on the component's state, like a dropdown menu. Also, my thought was enabling the usage of af-el generated components across any React component, it shouldn't be bound to a specific view, so it can be reused, for example - a navbar. I agree that something feels a bit odd with this behavior, but I would like to make some more thinking around it to have a better solution. If you have an alternative to that, do share!

Eytan

from appfairy.

DAB0mB avatar DAB0mB commented on May 24, 2024

I'll think what to do with it. Thank you for brinign it to my attention. Closing as it gets old

from appfairy.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.