Jaguar-dart / jaguar

Jaguar, a server framework built for speed, simplicity and extensible. ORM, Session, Authentication & Authorization, OAuth
http://jaguar-dart.github.io
463 stars 34 forks source link

How about refactoring the code for the response? #116

Closed xuexin closed 5 years ago

xuexin commented 6 years ago

We have a lot of response types now, and all of them have same attribute. But responses of them are mutually independent, it will cause confusions and bugs. Perhaps I do this in next weeks?

tejainece commented 6 years ago

Before, we had the same Response object, why I split them up is because having one Response object was kind of slow, as it had a if chain like this: https://github.com/Jaguar-dart/jaguar/blob/d6268cf99ac67c8e0bf9ec92e49ef09b0d01b8d9/lib/src/http/response/import.dart#L131

xuexin commented 6 years ago

It seems that I didn’t express enough. I mean the method writeResponse should be called by subclass, many process (like adding header) should be packaged in parent class.

tejainece commented 6 years ago

Sure! Send in the pull request.