Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ada-Trader-Mariana-Pipes #44

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

lmarianarp19
Copy link

Ada Trader

Congratulations! You're submitting your assignment!

Comprehension Questions

Question Answer
How do Backbone Views help structure your code? Views in Backbone are like controllers in Ruby, It helps to connect data with the DOM.
Did you use jQuery directly in your Views? How, and why? I can't use jQuery directly in the views, I need to use this.$(selector) in order to use jQuery. I used to select elements at the DOM.
What was an example of an event you triggered? Why did you need to trigger it? I trigger when a quote is buy or sell. I need to trigger this event because is a different type of event that I customize.
In what was is unit testing in JavaScript similar to unit testing in Ruby? In what ways is it different? The structure is very similar with the it and describe.

event.preventDefault();
const formData = this.getFormData();
formData['buy'] = event.target.classList[0] === ('btn-buy') ? true : false;
const newOrder = new Order(formData);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point you need to connect the new Order with its corresponding Quote. Probably the cleanest way to do this would be to add a function to QuoteList to get a Quote by symbol, and then pass the QuoteList into the OrderListView at instantiation.

This will allow you to validate the Order based on the current price, and to listen for price changes on the Quote so the Order can execute automatically when the price is right.

@droberts-sea
Copy link

Ada Trader

What We're Looking For

Feature Feedback
Core Requirements
Git hygiene This is a good start, but I would like to see more frequent and granular commits with more descriptive messages
Comprehension questions yes
Organization
Models and collections are defined in separate files yes
Code that relies on the DOM is located in or called by $(document).ready yes
Functionality
Quote prices change when clicking Buy and Sell yes
The Trade History updates when buying and selling a quote yes
A user can create an open order using the Order Entry Form yes
An open order removes itself from the open orders and updates the Trade History when fulfilled no
General
Has separate views for different parts of the app yes
Uses events (listening/handling and triggering) to manage different behavior in views yes
Practices good standards for views (ES6 syntax, doesn't directly use jQuery, returns this in render) yes
Error handling for the Order Entry Form no
Testing
Has unit tests for models no
Overall

This is a good start, but this submission is missing functionality that comes from connecting an Order to a Quote. Coordinating events across multiple components of a complex application is the core learning goal of this assignment, and making that connection is an important part of realizing that goal.

Event-driven programming is an important tool for the modern software engineer, especially in an asynchronous context like front-end JavaScript. It's also very different than the message-driven paradigm we've studied so far. Designing such programs is a unique challenge, as is knowing when and when not to use event-driven techniques. By this point you're probably mostly focused on your capstone project, but it would be worthwhile to spend some time focusing on this. Let me know if you want to sit down and work through making those connections together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants